Skip to content

Instantly share code, notes, and snippets.

@maxnikulin
Last active June 26, 2024 10:30
Show Gist options
  • Save maxnikulin/9aee674785dc909649be232ca834cd4e to your computer and use it in GitHub Desktop.
Save maxnikulin/9aee674785dc909649be232ca834cd4e to your computer and use it in GitHub Desktop.
Test GitHub renderer for Org mode

Issues with Org mode files renderer at GitHub

  • =Verbatim text= as link description.
  • ​~200B ZERO WIDTH SPACE~​ workaround does not work here.
  • It causes issues with pretty quotes in link description even with #+OPTIONS: ':nil (info “(org) Export Settings”). With partial verbatim text: (info =”(org) Export Settings”=)
  • An attempt with Special Symbols aka "entities" (\quot{}): (info "(org) Export Settings")
  • To use footnotes1
    • Explicitly enable the feature
      #+OPTIONS: f:t
              
    • Use separate definitions in the section named “Footnotes” (or its localized variant, no colon after the name) for compatibility with ox-html.
      Reference[fn:1]
      ** Footnotes
      [fn:1] Text of footnote.
              
    • Labels are used literally, so it is your responsibility to renumber them and perhaps avoid meaningful names if you are going to get numbers in the exported document.
    • Avoid anonymous footnotes
      Defined as [fn:: Text of anonymous footnote]
              

      They are not supported

    • If you have multiple headings then avoid inline footnotes otherwise they appear in every following section.
      Inline[fn:2: Footnote text]
              
  • Link to internal target see [[wallyqs/org-ruby#11 cross-references (wallyqs/

org-ruby)]]. Notice that GitHub URL breaks Org markup.

  • <<internal-target>>Target for an internal link
  • Inline code block src_elisp{(server-start)}
  • Export snippets for HTML level markup works, but with custom export backend @@c: e.g. for inline comments@@ they are exported literally.
  • Macro {{{comment(another attempt of inline comment)}}}

#+begin_center is ignored for this paragrapth

https://orgmode.org/worg/images/orgmode/org-mode-unicorn.png

#+caption: Org mode logo is ignored for the image above.

Header level 2

Test of multiple header levels.

Header level 3

Text of heading level 3.

Header level 4

Text of heading level 4.

Header level 5

Text of heading level 5.

Header level 6

Text of heading level 6.

Header level 7

Text of heading level 7.

Footnotes

1 Separate footnote text

Issues with footnotes in org-ruby

  • wallyqs/org-ruby#2 Support footnotes
  • Text of inline footnotes is duplicated outside of definitions.
  • Definitions are added to each following section.
  • The existing “Footnotes” heading is not used as the place where all definitions should appear.
  • Label namesname are not replaced by numbers.
  • Multiple references to the same footnotename have the same <a name="..."> attribute.
  • Anonymous footnotes: Anonymous footnote are not supported.
  • Footnotes references and definitions are not skipped when export of footnotes is disabled
    #+options: f:nil
        

    Instead they are exported literally.

Text before headings.1

Footnotes:

1 Inline footnote before headings.

Inline footnote before headings.

First heading

Paragraph in first heading.2

Separate footnote reference.name

Footnotes:

1Inline footnote before headings.

2 Inline footnote in first heading.

Inline footnote in first heading.

Second heading

Paragraph in second heading.3

Footnotes:

1Inline footnote before headings.

2Inline footnote in first heading.

3 Inline footnote in second heading.

Inline footnote in second heading.

Footnotes

name Separate footnote definition.

Footnotes:

1Inline footnote before headings.

2Inline footnote in first heading.

3Inline footnote in second heading.

Attempts to get centered element on GitHub

See wallyqs/org-ruby#93

#+begin_center block

Close to what org-ruby tries to do, but likely wiped by sanitizer:

style="text-align: center"

Deprecated in HTML5:

align="center"

Found in primer.css

class="text-center"

Deprecated in HTML:

Raw <center> tags

Test if GitHub markup allows centered text in .rst

See wallyqs/org-ruby#93

.. centered::

   This text should be centered

Code:

.. centered::

   This text should be centered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment