Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect ATTR_HTML above tables #93

Closed
kaushalmodi opened this issue Oct 31, 2017 · 3 comments
Closed

Respect ATTR_HTML above tables #93

kaushalmodi opened this issue Oct 31, 2017 · 3 comments

Comments

@kaushalmodi
Copy link
Owner

kaushalmodi commented Oct 31, 2017

First of all, as we are exporting the tables as Markdown tables, it's not natively supported by Hugo/Blackfriday.

The limitation is that we cannot wrap Markdown text with HTML tags (blackfriday#404) .. but below workaround seems to work with Blackfriday!

<div class="foo">
<div></div>

| a | b |
|---|---|
| c | d |

</div>

That will enable customizing width, border, and other CSS table attributes using #+ATTR_HTML!

Reference - For the workaround

@kaushalmodi
Copy link
Owner Author

Related: gohugoio/hugo#1585 (comment)

@kaushalmodi
Copy link
Owner Author

Propose a table shortcode addition to Hugo core to make this easy: https://discourse.gohugo.io/t/proposal-to-add-a-new-shortcode-table-to-hugo/9071

kaushalmodi added a commit that referenced this issue Nov 10, 2017
This commit changes the TOC style quite a bit from the earlier
version. Read the below mini-blog-in-commit for more info.

- Add new function org-hugo--get-headline-number
- org-hugo-heading - Use above.

- org-hugo--build-toc - Generate unordered list instead of ordered
- Update/add tests!

@punchagan: You are most likely one of the few affected by the
backward incompatible change in this commit. To get sort of the old
style of numbered headings in TOC (while unnumbered headings in post
body), set `num' to `onlytoc`. Let me know how it works.

=== mini blog ===

Earlier, the TOC was exported as ordered list in Markdown. That
imposed a limitation that allowed exporting only the last number from
a section number.

So instead of:

  1. Section 1
      1.1 Section 1.1
      1.2 Section 1.2

It would export as:

  1. Section 1
      1. Section 1.1
      2. Section 1.2

Now the TOC is generated as an *unordered* list in Markdown.

  - 1. Section 1
      - 1.1 Section 1.1
      - 1.2 Section 1.2

That would cause both bullets and numbers to show in HTML, so I am
using a nifty little trick I discovered in
#93 to hide those
bullets **if the section numbers are present**.

In addition, I also wrap the section numbers in "section-num" class so
that user can choose to format them however they like using CSS (May
be even hide them).

===

Fixes #76
@kaushalmodi
Copy link
Owner Author

kaushalmodi commented Jan 8, 2018

Holy grail of HTML5 tables: https://css-tricks.com/complete-guide-table-element/

  • Add tests to match the examples on that page.

kaushalmodi added a commit that referenced this issue Jan 8, 2018
kaushalmodi added a commit that referenced this issue Jan 9, 2018
It works almost the same way as ox-html, but a little hack is add to
get around a Hugo/Blackfriday limitation that Markdown text cannot be
wrapped in HTML elements like div. Details:
#93.

Fixes #105.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant