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

Src/Example blocks use code fence instead of highlight if Goldmark #499

Merged
merged 8 commits into from Jan 5, 2022

Conversation

kaushalmodi
Copy link
Owner

@kaushalmodi kaushalmodi commented Jan 4, 2022

Fixes #305 and #161.

Also see #485.

@kaushalmodi kaushalmodi changed the title Example blocks use code fence instead of highlight if Goldmark Src/Example blocks use code fence instead of highlight if Goldmark Jan 4, 2022
@kaushalmodi kaushalmodi force-pushed the code-fence-instead-of-highlight branch from 8d2b00c to 93f2ee9 Compare January 4, 2022 17:58
kaushalmodi added a commit that referenced this pull request Jan 4, 2022
This hack was to get around a limitation of the Pygments syntax
highlighter about 5 years back (Pygments did not know how to highlight
`org` lang!). But this hack wasn't necessary once Hugo started using
Chroma after v0.28.

Ref: #60

Reasons for removing this hack blatantly:

- I was probably the only one using it, but stopped using this after
  Oct 2017.
- It's creating too much noise in the code. So I want to clean this up
  before I add commits for #499.
- And I don't want to support this hack any more.
- If someone still is using a Hugo version older than 0.28 and is using
  Pygments, they need to update. (ok.. if you really don't want to
  update, use the new `org-blackfriday-syntax-highlighting-langs` and
  add `("org" . "text")` to it.)
kaushalmodi added a commit that referenced this pull request Jan 4, 2022
This hack was to get around a limitation of the Pygments syntax
highlighter about 5 years back (Pygments did not know how to highlight
`org` lang!). But this hack wasn't necessary once Hugo started using
Chroma after v0.28.

Ref: #60

Reasons for removing this hack blatantly:

- I was probably the only one using it, but stopped using this after
  Oct 2017.
- It's creating too much noise in the code. So I want to clean this up
  before I add commits for #499.
- And I don't want to support this hack any more.
- If someone still is using a Hugo version older than 0.28 and is using
  Pygments, they need to update. (ok.. if you really don't want to
  update, use the new `org-blackfriday-syntax-highlighting-langs` and
  add `("org" . "text")` to it.)
@kaushalmodi kaushalmodi force-pushed the code-fence-instead-of-highlight branch from 93f2ee9 to 99eb69e Compare January 4, 2022 22:10
No functional change

Refactoring done for better code clarity and to prep up for the
changes needed in src block export for
#305.
@kaushalmodi kaushalmodi force-pushed the code-fence-instead-of-highlight branch from 99eb69e to f959758 Compare January 4, 2022 22:11
Use the `example-code` derived from `org-hugo-example-block` in
`org-blackfriday-example-block` even when line numbers are not
enabled, but fenced code blocks are enabled (`use-highlight-sc` ==
nil).

It's not a ground breaking optimization.. just that a call to
`org-export-format-code-default` will be skipped in
`org-blackfriday-example-block`.
kaushalmodi added a commit that referenced this pull request Jan 4, 2022
Ref:
- #499
- #305

If you don't like the change in behavior of src block exports in this
commit, customize `org-hugo-goldmark`. See
#485.
kaushalmodi added a commit that referenced this pull request Jan 4, 2022
Ref:
- #499
- #305

This update also "fixes"
#161.

The code fenced block don't have the same issue as the `highlight`
shortcode does. As we now export line numbered code blocks as fenced
code blocks by default and are moving away from the buggy `highlight`
shortcode, we are bypassing issue
#161.

If you don't like the change in behavior of src block exports in this
commit, customize `org-hugo-goldmark`. See
#485.
@kaushalmodi kaushalmodi force-pushed the code-fence-instead-of-highlight branch from e59c1e6 to 19c6f50 Compare January 4, 2022 23:55
Ref:
- #499
- #305

This update also "fixes"
#161.

The code fenced block don't have the same issue as the `highlight`
shortcode does. As we now export line numbered code blocks as fenced
code blocks by default and are moving away from the buggy `highlight`
shortcode, we are bypassing issue
#161.

If you don't like the change in behavior of src block exports in this
commit, customize `org-hugo-goldmark`. See
#485.
@kaushalmodi kaushalmodi force-pushed the code-fence-instead-of-highlight branch from 19c6f50 to 3bccbd8 Compare January 4, 2022 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export to code fences with attributes instead of using the buggy highlight shortcode
1 participant