]> code.delx.au - gnu-emacs-elpa/commitdiff
Support htmlize.el in Rakefile doc target
authorNoam Postavsky <npostavs@users.sourceforge.net>
Sun, 1 May 2016 02:11:49 +0000 (22:11 -0400)
committerNoam Postavsky <npostavs@users.sourceforge.net>
Sun, 1 May 2016 02:36:34 +0000 (22:36 -0400)
Htmlized output can now be produced by

    rake doc[/path/to/htmlize/]

* Rakefile (doc): Add htmlize argument.
* doc/yas-doc-helper.el (yas--generate-html-batch): Tell org to use css
selectors only when exporting htmlized faces.
* doc/stylesheets/manual.css: Add styles for faces used by org export.

Rakefile
doc/stylesheets/manual.css
doc/yas-doc-helper.el

index 9986b7568dc15b44f92f72a01097ed9b86ff4651..f88237bd762c58433d2719c2668f41086cd8e220 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -45,8 +45,12 @@ task :release => [:package, 'doc:archive'] do
 end
 
 desc "Generate document"
-task :doc do
-  sh "#{$EMACS} -Q -L . --batch -l doc/yas-doc-helper.el" +
+task :doc, [:htmlize] do |t, args|
+  load_path = '-L .'
+  if args[:htmlize]
+    load_path += " -L #{args[:htmlize]}"
+  end
+  sh "#{$EMACS} -Q #{load_path} --batch -l doc/yas-doc-helper.el" +
     " -f yas--generate-html-batch"
 end
 
index f2677c5a4fbb0e4b2d2fd02a533d528685e303f6..9580347a25288ee7acf9c3d99956e38921d88bd7 100644 (file)
@@ -24,3 +24,36 @@ code {
     margin-left: 5%;
     margin-right: 10%;
 }
+
+/* Styles for htmlize.el fontification.  */
+
+.org-comment        { color: #005000; }    /* font-lock-comment-face */
+.org-keyword        { font-weight: bold; } /* font-lock-keyword-face */
+.org-string         { color: #8b0000; }    /* font-lock-string-face */
+.org-warning        { color: #ff8c00;
+                      font-weight: bold; } /* warning */
+.org-warning-1      { color: #ff0000;
+                      font-weight: bold; } /* font-lock-warning-face */
+.org-preprocessor   { color: #483d8b; }    /* font-lock-preprocessor-face */
+.org-constant       { color: #008b8b; }    /* font-lock-constant-face */
+.org-function-name  { color: #0000ff; }    /* font-lock-function-name-face */
+.org-type           { color: #228b22; }    /* font-lock-type-face */
+.org-variable-name  { color: #a0522d; }    /* font-lock-variable-name-face */
+
+.org-rst-adornment  { color: #a020f0; }            /* rst-adornment */
+.org-rst-block      { color: #a020f0; }            /* rst-block */
+.org-rst-comment    { color: #b22222; }            /* rst-comment */
+.org-rst-definition { color: #0000ff; }            /* rst-definition */
+.org-rst-directive  { color: #483d8b; }            /* rst-directive */
+.org-rst-emphasis1  { font-style: italic; }        /* rst-emphasis1 */
+.org-rst-emphasis2  { font-weight: bold; }         /* rst-emphasis2 */
+.org-rst-external   { color: #228b22; }            /* rst-external */
+.org-rst-level-1    { background-color: #d9d9d9; } /* rst-level-1 */
+.org-rst-level-2    { background-color: #c7c7c7; } /* rst-level-2 */
+.org-rst-level-3    { background-color: #b5b5b5; } /* rst-level-3 */
+.org-rst-level-4    { background-color: #a3a3a3; } /* rst-level-4 */
+.org-rst-level-5    { background-color: #919191; } /* rst-level-5 */
+.org-rst-level-6    { background-color: #7f7f7f; } /* rst-level-6 */
+.org-rst-literal    { color: #8b2252; }            /* rst-literal */
+.org-rst-reference  { color: #a0522d; }            /* rst-reference */
+.org-rst-transition { color: #a020f0; }            /* rst-transition */
index f4cd49bfdf98ea5381d65e8d181edd5c0770efe5..8459eb75f2d8b439ada96867fcc4b7998cd1f123 100644 (file)
   (let ((org-publish-use-timestamps-flag nil)
         (org-export-copy-to-kill-ring nil)
         (org-confirm-babel-evaluate nil)
-        (make-backup-files nil))
+        (make-backup-files nil)
+        (org-html-htmlize-output-type 'css))
     (org-publish "yasnippet" 'force)))