Skip to content

Commit

Permalink
adds explicit css naming options
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferyshivers committed Mar 14, 2017
1 parent 9677c5f commit eec17f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
17 changes: 10 additions & 7 deletions annotate/config.ily
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
\registerOption scholarly.annotate.export.html.labels
#`((critical-remark . "Critical Remark")
(musical-issue . "Musical Issue")
(lilypond-issue . "Lilypond Issue>")
(lilypond-issue . "Lilypond Issue")
(question . "Question")
(todo . "TODO"))

Expand All @@ -152,7 +152,7 @@
% Annotation div types (can technically be anything, since they get directly
% converted to string; so even a new type of div, or `a`, or whatever else.)
\registerOption scholarly.annotate.export.html.divs
#`((full-ann-list . ul) ;; the div containing all annotations
#`((full-ann-list . ol) ;; the div containing all annotations
(each-ann-outer . li) ;; the outer shell of an annotation
(each-ann-inner . ul) ;; the inner shell of an annotation
(each-ann-props . li) ;; each prop
Expand All @@ -165,7 +165,7 @@

% Which labels to print for props (only affect props included in previous list)
\registerOption scholarly.annotate.export.html.prop-labels
#`((type . "Type: ")
#`((type . "<em>Type:</em> ")
(grob-location . #f)
(grob-type . #f)
(message . #f))
Expand All @@ -176,8 +176,11 @@
% and point to the default stylesheet. We happen to refer to that here
% by default anyway. But the name/location of that default styles should
% be hardcoded into export-html.ily presumably.
\registerOption scholarly.annotate.export.html.css-name
#"default-styles.css"
\registerOption scholarly.annotate.export.html.external-css-name
#"my-external-styles.css"

\registerOption scholarly.annotate.export.html.generate-css-name
#"my-generated-styles.css"


% How to handle CSS upon html export
Expand All @@ -188,10 +191,10 @@
#`linked


% Which CSS to use when used at all
% Which CSS to use when used at all (default is the fallback if not one of the other two)
% #`default = handle the default CSS included in the repository
% #`generate = generate a new CSS (using the name from `css-name` option)
% #`external =
% #`external = (link to) external stylesheet (does not support *importing* yet)
\registerOption scholarly.annotate.export.html.use-css
#`default

Expand Down
8 changes: 7 additions & 1 deletion annotate/export-html.ily
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@

;; If option is True, add the header and body
(if full-doc
(let* ((css-type (getOption `(scholarly annotate export html use-css)))
(css-name (cond ((equal? css-type 'generate)

This comment has been minimized.

Copy link
@uliska

uliska Mar 14, 2017

Contributor

As we're comparing against symbols eq? can be used.

(getOption `(scholarly annotate export html generate-css-name)))
((equal? css-type 'external)
(getOption `(scholarly annotate export html external-css-name)))
(else "default-stylesheet.css"))))
(append-to-output-stringlist (format
"<!DOCTYPE html>
<html>
Expand All @@ -107,7 +113,7 @@
</head>
<body>
" (getOption `(scholarly annotate export html css-name)))))
" css-name))))

;; wrap everything in the annotations div. this is sort of redundant, but
;; could be useful if projects have multiple bookparts with annotation lists.
Expand Down

0 comments on commit eec17f2

Please sign in to comment.