Permalink
Browse files

Lower case all Org keywords

Let there be:

    #+options:

    #+begin_src emacs-lisp
    ...
    #+end_src

    .. and so on.

Command used for this lower case conversion:

    (defun modi/lower-case-org-keywords ()
      "Lower case Org keywords and block identifiers.

    Example: \"#+TITLE\" -> \"#+title\"
             \"#+BEGIN_EXAMPLE\" -> \"#+begin_example\"

    Inspiration:
    https://code.orgmode.org/bzg/org-mode/commit/13424336a6f30c50952d291e7a82906c1210daf0."
      (interactive)
      (save-excursion
        (goto-char (point-min))
        (let ((case-fold-search nil)
              (count 0))
          ;; Match examples: "#+FOO ", "#+FOO:", "=#+FOO=", "~#+FOO~",
          ;;                 ",#+FOO ", "#+FOO_bar ", "#+FOO<eol>".
          (while (re-search-forward "\\(?1:#\\+[A-Z_]+\\(?:_[[:alpha:]]+\\)*\\)\\(?:[ :=~’”]\\|$\\)" nil :noerror)
            (setq count (1+ count))
            (replace-match (downcase (match-string-no-properties 1)) :fixedcase nil nil 1))
          (message "Lower-cased %d matches" count))))
  • Loading branch information...
kaushalmodi committed Feb 2, 2018
1 parent 0150797 commit ad1b513c0847383d19bf37becce6413697d14bd0
Showing with 1,141 additions and 1,134 deletions.
  1. +24 −24 README.org
  2. +25 −25 doc/github-files.org
  3. +198 −196 doc/ox-hugo-manual.org
  4. +6 −6 ox-blackfriday.el
  5. +43 −38 ox-hugo.el
  6. +1 −1 test/site/README.org
  7. +530 −530 test/site/content-org/all-posts.org
  8. +5 −5 test/site/content-org/auto-set-lastmod.org
  9. +5 −5 test/site/content-org/construct-hugo-front-matter-from-menu-meta-data.org
  10. +8 −8 test/site/content-org/deep-nesting.org
  11. +4 −4 test/site/content-org/hugo-menu-as-keyword.org
  12. +5 −5 test/site/content-org/hugo-weight-as-keyword-auto-calc.org
  13. +8 −8 test/site/content-org/images-in-content/images-in-content.org
  14. +7 −7 test/site/content-org/images-in-content/post3/post3.org
  15. +7 −7 test/site/content-org/images-in-content/post4/post4.org
  16. +58 −58 test/site/content-org/keyword-collection.org
  17. +4 −4 test/site/content-org/mandatory-EXPORT_FILE_NAME-for-subtree-export.org
  18. +5 −5 test/site/content-org/screenshot-subtree-export-example.org
  19. +5 −5 test/site/content-org/single-posts/allow-empty-titles-1.org
  20. +6 −6 test/site/content-org/single-posts/disable-title-1.org
  21. +4 −4 test/site/content-org/single-posts/export-without-emphasize.org
  22. +6 −6 test/site/content-org/single-posts/hugo-auto-weight-ineffective-for-per-file-exports.org
  23. +11 −11 test/site/content-org/single-posts/post-draft.org
  24. +10 −10 test/site/content-org/single-posts/post-toml.org
  25. +11 −11 test/site/content-org/single-posts/post-yaml.org
  26. +14 −14 test/site/content-org/src-blocks-with-highlight-shortcode.org
  27. +13 −13 test/site/content-org/tags-and-categories.org
  28. +9 −9 test/site/content-org/template.org
  29. +13 −13 test/site/content-org/writing-hugo-blog-in-org-file-export.org
  30. +1 −1 test/site/content/posts/alert-short-code-lookalike.md
  31. +1 −1 test/site/content/posts/allow-empty-titles-1.md
  32. +1 −1 test/site/content/posts/disable-title-1.md
  33. +1 −1 test/site/content/posts/example-block-with-escaped-org-inside-quote-block.md
  34. +11 −11 test/site/content/posts/figure-shortcode-and-attr-html.md
  35. +1 −1 test/site/content/posts/hugo-auto-weight-ineffective-for-per-file-exports.md
  36. +3 −3 test/site/content/posts/image-links.md
  37. +3 −3 test/site/content/posts/inheriting-tags.md
  38. +12 −12 test/site/content/posts/keyword-collection.md
  39. +10 −10 test/site/content/posts/links-to-images.md
  40. +16 −16 test/site/content/posts/links-to-source-blocks.md
  41. +10 −10 test/site/content/posts/links-to-tables.md
  42. +1 −1 test/site/content/posts/links-with-target-attribute.md
  43. +1 −1 test/site/content/posts/menu-meta-data-yaml.md
  44. +2 −2 test/site/content/posts/no-toc-in-summary.md
  45. +1 −1 test/site/content/posts/overriding-tags.md
  46. +1 −1 test/site/content/posts/source-block-md-with-hugo-shortcodes.md
  47. +6 −6 test/site/content/posts/source-block-with-highlighting.md
  48. +8 −8 test/site/content/posts/source-block-with-line-numbers.md
  49. +4 −4 test/site/content/posts/table-styling.md
  50. +2 −2 test/site/content/writing-hugo-blog-in-org-file-export.md
@@ -42,7 +42,7 @@ as it makes the meta-data management for Hugo front-matter pretty
effortless.
If you are a /one Org-file per post/ type of a person, that flow works
too! Just note that in this flow many of those =#+HUGO_= properties
too! Just note that in this flow many of those =#+hugo_= properties
need to be managed manually.. just as one would manage the front-matter
in Markdown files --- See the Org versions in the above screenshots for
comparison.
@@ -153,13 +153,13 @@ The common =ox-hugo= export bindings are:
A /valid Hugo post subtree/ is an Org subtree has the
=EXPORT_FILE_NAME= property set.
- If the file is intended to be exported as a whole (i.e. has the
=#+TITLE= keyword), export the whole Org file to a Hugo post in
=#+title= keyword), export the whole Org file to a Hugo post in
Markdown.
- =C-c C-e H A= :: Export *all* "What I Mean"
- If the Org file has one or more 'valid Hugo post subtrees', export
them to Hugo posts in Markdown.
- If the file is intended to be exported as a whole (i.e. no 'valid
Hugo post subtrees' at all, and has the =#+TITLE= keyword), export
Hugo post subtrees' at all, and has the =#+title= keyword), export
the whole Org file to a Hugo post in Markdown.
*** For only the one-post-per-file flow
- =C-c C-e H h= :: Export the Org file to a Hugo post in Markdown.
@@ -175,10 +175,10 @@ available customization options for this package.
- Support exporting =resources= front-matter (Hugo v0.33+) --
#[[https://github.com/kaushalmodi/ox-hugo/issues/115][115]].
- Support exporting =headless= front-matter (Hugo v0.35+).
- Advanced table styling is now possible by specifying =#+ATTR_HTML=
and =#+ATTR_CSS= (this one is unique to =ox-hugo=) above Org
- Advanced table styling is now possible by specifying =#+attr_html=
and =#+attr_css= (this one is unique to =ox-hugo=) above Org
tables. See its [[https://ox-hugo.scripter.co/doc/table-styling/][documentation]] -- #[[https://github.com/kaushalmodi/ox-hugo/issues/93][93]].
- Similarly, support =#+ATTR_HTML= and =#+ATTR_CSS= for paragraphs,
- Similarly, support =#+attr_html= and =#+attr_css= for paragraphs,
example blocks, source blocks, plain lists and quote blocks too --
#[[https://github.com/kaushalmodi/ox-hugo/issues/113][113]].
- Now =publishdate= and =expirydate= front-matter properties get
@@ -202,9 +202,9 @@ available customization options for this package.
- Support Org Special Blocks [[https://www.gnu.org/software/emacs/manual/html_node/org/Special-blocks.html][like in HTML and LaTeX exports]] --
#[[https://github.com/kaushalmodi/ox-hugo/issues/105][105]]. Here's one little example:
#+BEGIN_SRC org
,#+BEGIN_mark
,#+begin_mark
/Some/ *marked* text
,#+END_mark
,#+end_mark
#+END_SRC
- Allow setting =:EXPORT_HUGO_SECTION:= in the valid Hugo post subtree
itself.
@@ -218,15 +218,15 @@ available customization options for this package.
v0.32+).
*** Backward-incompatible changes
- A "better user-experience" change.. now you do not need to use
/double-underscores/ as /space/ replacement in =#+HUGO_TAGS=,
=#+HUGO_CATEGORIES= and =#+KEYWORDS=. See this commit for details
/double-underscores/ as /space/ replacement in =#+hugo_tags=,
=#+hugo_categories= and =#+keywords=. See this commit for details
and examples -- commit [[https://github.com/kaushalmodi/ox-hugo/commit/319435db][319435db]].
*** Fixes
- Fix =HUGO_LEVEL_OFFSET= not getting set -- #[[https://github.com/kaushalmodi/ox-hugo/issues/117][117]], thanks
@[[https://github.com/shimmy1996][*shimmy1996*]]!
- Fix internal subtree counter not getting reset after a file-based
export.
- Fix clickable image links with =#+NAME= -- commit [[https://github.com/kaushalmodi/ox-hugo/commit/fef0ec50][fef0ec50]].
- Fix clickable image links with =#+name= -- commit [[https://github.com/kaushalmodi/ox-hugo/commit/fef0ec50][fef0ec50]].
- Make title text rendering more robust.. now Markdown markup
characters like =*=, =_= and =`= show up fine, verbatim, in the
title.
@@ -250,7 +250,7 @@ available customization options for this package.
#[[https://github.com/kaushalmodi/ox-hugo/issues/99][99]].
- Support specifying multiple [[https://gohugo.io/templates/output-formats/][hugo output formats]] .. Now the =outputs=
front-matter variable is a list.
- Support the Org =#+AUTHOR= and =#+CREATOR= keywords and their
- Support the Org =#+author= and =#+creator= keywords and their
respective Org Export Options -- #[[https://github.com/kaushalmodi/ox-hugo/issues/106][106]].
- Support Org Export Snippets and Export Blocks --
commit [[https://github.com/kaushalmodi/ox-hugo/commit/1149f20cd][1149f20cd]].
@@ -346,11 +346,11 @@ available customization options for this package.
*** Features
- Export TOC as a Markdown ordered list. See [[https://ox-hugo.scripter.co/doc/org-toc][Table of
Contents]] -- #[[https://github.com/kaushalmodi/ox-hugo/issues/88][88]].
- =#+ATTR_HTML= above http/https/ftp links is now supported (useful
- =#+attr_html= above http/https/ftp links is now supported (useful
for specifying the =target=, =rel=, attributes, for example).
** v0.4.1 <2017-10-29 Sun>
*** Features
- Support specifying the =:height= parameter in the =#+ATTR_HTML=
- Support specifying the =:height= parameter in the =#+attr_html=
above image links. That eventually gets transformed to the =height=
parameter in the =figure= tag in the HTML generated by Hugo. This
feature requires building Hugo from its master branch with commit
@@ -359,28 +359,28 @@ available customization options for this package.
- Fix =EXPORT_HUGO_SECTION= not getting inherited #[[https://github.com/kaushalmodi/ox-hugo/issues/90][90]].
** v0.4 <2017-10-28 Sat>
*** Backward-incompatible changes
- Restore the default Org behavior of =#+TAGS=. Now that keyword (and
- Restore the default Org behavior of =#+tags=. Now that keyword (and
the =EXPORT_TAGS= property) is *not* used by =ox-hugo=. Fixes
#[[https://github.com/kaushalmodi/ox-hugo/issues/89][89]].
- File-based exports must now use =#+HUGO_TAGS= to set the post tags.
- File-based exports must now use =#+hugo_tags= to set the post tags.
- Subtree-based exports can use the =EXPORT_HUGO_TAGS= property to
override Org-style tags on the same headline (and the ones inherited
from Org-style tags from any of the parent subtrees and
=#+FILETAGS=).
- Note that for subtree-based exports, =#+FILETAGS= can be used to
set tags globally in the file. Earlier =#+TAGS= was used for that
=#+filetags=).
- Note that for subtree-based exports, =#+filetags= can be used to
set tags globally in the file. Earlier =#+tags= was used for that
purpose.
- Subtree-based exports can use the =EXPORT_HUGO_CATEGORIES= property
to override Org-style categories (tags with "@" prefix) on the same
headline (and the ones inherited from Org-style categories from any
of the parent subtrees and =#+FILETAGS=).
- Note that for subtree-based exports, =#+FILETAGS= can be used to
of the parent subtrees and =#+filetags=).
- Note that for subtree-based exports, =#+filetags= can be used to
set categories (tags with "@") globally in the file.
See the new section added to documentation:
[[https://ox-hugo.scripter.co/doc/tags-and-categories][*Tags and Categories*]]
*** Features
- Support specifying the =:width= parameter in the =#+ATTR_HTML= above
- Support specifying the =:width= parameter in the =#+attr_html= above
image links. That eventually gets transformed to the =width=
parameter in the =figure= tag in the HTML generated by Hugo.
** v0.3.2 <2017-10-24 Tue>
@@ -413,7 +413,7 @@ See the new section added to documentation:
- Now =ox-hugo= by default requires text, to be sub/super-scripted, to
be wrapped in ={}=. So now =a_b= will be exported as =a_b=, but
=a_{b}= will be exported as =a<sub>b</sub>=. To revert back to the
earlier behavior, user needs to add =#+OPTIONS: ^:t= to their Org
earlier behavior, user needs to add =#+options: ^:t= to their Org
file.
** v0.2.1 <2017-09-28 Thu>
*** Fixes
@@ -440,7 +440,7 @@ See the new section added to documentation:
- Switch the default value of =org-hugo-use-code-for-kbd= option to
=nil= [[[https://github.com/kaushalmodi/ox-hugo/commit/88ba15ae9bc809b0983315446c88fecfda3534e5][88ba15ae]]].
** v0.1.3 <2017-09-13 Wed>
- Now a HUGO key value set to ="nil"=, like =#+HUGO_CODE_FENCE: nil=,
- Now a HUGO key value set to ="nil"=, like =#+hugo_code_fence: nil=,
will evaluate as /nil/ instead of /t/, as now
=org-hugo--plist-get-true-p= is used to parse boolean keys instead
of =plist-get=.
@@ -1,18 +1,18 @@
#+TITLE: GitHub Ancillary Files
#+AUTHOR: Kaushal Modi
#+title: GitHub Ancillary Files
#+author: Kaushal Modi
#+MACRO: commit commit [[https://github.com/kaushalmodi/ox-hugo/commit/$1][$1]]
#+MACRO: issue #[[https://github.com/kaushalmodi/ox-hugo/issues/$1][$1]]
#+MACRO: bfissue Blackfriday # [[https://github.com/russross/blackfriday/issues/$1][$1]]
#+MACRO: hugoissue Hugo #[[https://github.com/gohugoio/hugo/issues/$1][$1]]
#+MACRO: imageclick [[https://raw.githubusercontent.com/kaushalmodi/ox-hugo/master/doc/static/images/$1][https://raw.githubusercontent.com/kaushalmodi/ox-hugo/master/doc/static/images/$1]]
#+MACRO: doc [[https://ox-hugo.scripter.co/doc/$1][$2]]
#+MACRO: travis [[https://travis-ci.org/kaushalmodi/ox-hugo][https://travis-ci.org/kaushalmodi/ox-hugo.svg?branch=master]]
#+MACRO: melpa [[https://melpa.org/#/ox-hugo][file:https://melpa.org/packages/ox-hugo-badge.svg]]
#+MACRO: GPLv3 [[https://www.gnu.org/licenses/gpl-3.0][https://img.shields.io/badge/License-GPL%20v3-blue.svg]]
#+MACRO: gitter [[https://gitter.im/KaushalModi/Lobby][https://badges.gitter.im/KaushalModi/Lobby.svg]]
#+MACRO: saythanks [[https://saythanks.io/to/kaushalmodi][https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg]]
#+MACRO: user @[[https://github.com/$1][*$1*]]
#+macro: commit commit [[https://github.com/kaushalmodi/ox-hugo/commit/$1][$1]]
#+macro: issue #[[https://github.com/kaushalmodi/ox-hugo/issues/$1][$1]]
#+macro: bfissue Blackfriday # [[https://github.com/russross/blackfriday/issues/$1][$1]]
#+macro: hugoissue Hugo #[[https://github.com/gohugoio/hugo/issues/$1][$1]]
#+macro: imageclick [[https://raw.githubusercontent.com/kaushalmodi/ox-hugo/master/doc/static/images/$1][https://raw.githubusercontent.com/kaushalmodi/ox-hugo/master/doc/static/images/$1]]
#+macro: doc [[https://ox-hugo.scripter.co/doc/$1][$2]]
#+macro: travis [[https://travis-ci.org/kaushalmodi/ox-hugo][https://travis-ci.org/kaushalmodi/ox-hugo.svg?branch=master]]
#+macro: melpa [[https://melpa.org/#/ox-hugo][file:https://melpa.org/packages/ox-hugo-badge.svg]]
#+macro: GPLv3 [[https://www.gnu.org/licenses/gpl-3.0][https://img.shields.io/badge/License-GPL%20v3-blue.svg]]
#+macro: gitter [[https://gitter.im/KaushalModi/Lobby][https://badges.gitter.im/KaushalModi/Lobby.svg]]
#+macro: saythanks [[https://saythanks.io/to/kaushalmodi][https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg]]
#+macro: user @[[https://github.com/$1][*$1*]]
* Readme :readme:
:PROPERTIES:
@@ -23,13 +23,13 @@
{{{gitter}}} {{{saythanks}}}
#+INCLUDE: "./ox-hugo-manual.org::#introduction" :only-contents t
#+include: "./ox-hugo-manual.org::#introduction" :only-contents t
** Table of Contents :TOC:
# TOC will be inserted here by `toc-org' package when running
# `ox-hugo-export-gh-doc'.
** Screenshots :noexport_1:
#+INCLUDE: "./ox-hugo-manual.org::#screenshots_intro" :only-contents t
#+INCLUDE: "./ox-hugo-manual.org::#screenshots" :only-contents t
#+include: "./ox-hugo-manual.org::#screenshots_intro" :only-contents t
#+include: "./ox-hugo-manual.org::#screenshots" :only-contents t
** Documentation
=ox-hugo= uses *itself* to generate its documentation!
@@ -49,23 +49,23 @@ doc_md=.
The documentation site is published by first using =ox-hugo= to
export from Org to Markdown, and then finally =hugo=.
/So no Markdown files are committed in the =doc/content/= directory./
#+INCLUDE: "./ox-hugo-manual.org::#demo" :minlevel 2
#+include: "./ox-hugo-manual.org::#demo" :minlevel 2
** Installation
#+INCLUDE: "./ox-hugo-manual.org::#installation" :only-contents t
#+include: "./ox-hugo-manual.org::#installation" :only-contents t
** Usage
#+INCLUDE: "./ox-hugo-manual.org::#usage" :only-contents t
#+include: "./ox-hugo-manual.org::#usage" :only-contents t
** Changelog :noexport_1:
#+INCLUDE: "./ox-hugo-manual.org::#changelog" :only-contents t
#+include: "./ox-hugo-manual.org::#changelog" :only-contents t
** Thanks
#+INCLUDE: "./ox-hugo-manual.org::#thanks" :only-contents t
#+include: "./ox-hugo-manual.org::#thanks" :only-contents t
* Contributing :contributing:
:PROPERTIES:
:EXPORT_TITLE: Contributing Guide
:EXPORT_FILE_NAME: CONTRIBUTING
:END:
#+INCLUDE: "./ox-hugo-manual.org::#note-to-future-contributors" :only-contents t
#+include: "./ox-hugo-manual.org::#note-to-future-contributors" :only-contents t
** Debug
#+INCLUDE: "./ox-hugo-manual.org::#debug" :only-contents t
#+include: "./ox-hugo-manual.org::#debug" :only-contents t
** Test
#+INCLUDE: "./ox-hugo-manual.org::#test" :only-contents t
#+include: "./ox-hugo-manual.org::#test" :only-contents t
Oops, something went wrong.

0 comments on commit ad1b513

Please sign in to comment.