Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
021a906
Initial HTML export
jefferyshivers Mar 6, 2017
6f1d9f3
add output html for example
jefferyshivers Mar 6, 2017
07d8e2e
WIP adds some special config options for html and css
jefferyshivers Mar 7, 2017
8ad731b
html and css example
jefferyshivers Mar 7, 2017
90e0eb9
implements format-location and removes default props to print (user m…
jefferyshivers Mar 7, 2017
609f89b
make export procedure / filenames configurable with options
jefferyshivers Mar 7, 2017
f17cdf9
make annotations a div with so named class again
jefferyshivers Mar 7, 2017
53121cc
Merge branch 'master' into export-html
jefferyshivers Mar 7, 2017
9a4ceb8
adds html-id prop check/addition for each annotation
jefferyshivers Mar 11, 2017
6cd604b
simplify div-open procedure, make code more legible
jefferyshivers Mar 11, 2017
e0eaf62
simplify procedure for getting html props
jefferyshivers Mar 11, 2017
118e897
adds setOption example for testing html props, removes comment
jefferyshivers Mar 11, 2017
7c6c636
seperate type class names vs type output labels
jefferyshivers Mar 11, 2017
b2c511f
remove option to rename type classes, it is an useless option right now
jefferyshivers Mar 11, 2017
96819a7
update readme to reflect html output
jefferyshivers Mar 11, 2017
9db4a68
add opt to print full doc or just annotations div
jefferyshivers Mar 12, 2017
9384bf7
remove html stuff
jefferyshivers Mar 12, 2017
dc73d39
add the word 'json' to paragraph
jefferyshivers Mar 12, 2017
169cbc3
add <html> and doctype as well
jefferyshivers Mar 12, 2017
dfd8df2
add utf-8 charset to html page
uliska Mar 12, 2017
83fb277
Use format instead of chained string-append
uliska Mar 12, 2017
6d48a1f
Fix indent of commit dfd8df20 (oops)
uliska Mar 12, 2017
871d6e7
adds a few more conenience fns for cleanliness; implements option to …
jefferyshivers Mar 13, 2017
e56f927
just remove deprecated conenience fn
jefferyshivers Mar 13, 2017
10444ed
adds initial ability to simply print prop labels (like 'Type: ') with…
jefferyshivers Mar 14, 2017
b7db871
Replace series' of println with single expressions
uliska Mar 14, 2017
35a7c7d
Remove "println" helper function
uliska Mar 14, 2017
590327f
Adapt indentation to Frescobaldi style
uliska Mar 14, 2017
39bba6e
Simpler implementation of nest-indent
uliska Mar 14, 2017
ea1cb51
Reduce redundant code in "div-open"
uliska Mar 14, 2017
9677c5f
rename nest-indent to indent
uliska Mar 14, 2017
eec17f2
adds explicit css naming options
jefferyshivers Mar 14, 2017
654b7cd
change equal to eq and just fix indentation
jefferyshivers Mar 14, 2017
c9b4745
WIP a css formatter for exported or header (generated, or default)
jefferyshivers Mar 15, 2017
98f4464
trivial, remove unnecessary let* asterisk
jefferyshivers Mar 15, 2017
6558709
prints formatted css to header (not totally clean yet, visually-speak…
jefferyshivers Mar 15, 2017
8371f0b
formats css prettier
jefferyshivers Mar 15, 2017
7f6deec
WIP filling in css formatting procedure 1 of 2
jefferyshivers Mar 15, 2017
a71c56b
oops this goes with previous commit
jefferyshivers Mar 15, 2017
2c17aa8
fix use-css functionality, now prints default or custom into header
jefferyshivers Mar 15, 2017
5b28f0d
applies optional 'annotations' div class/id if specified
jefferyshivers Mar 15, 2017
38448b1
updates example generated css
jefferyshivers Mar 15, 2017
da8ae30
outputs generated css file if option selected
jefferyshivers Mar 15, 2017
141fa37
adds comments
jefferyshivers Apr 11, 2017
05d5058
Merge branch 'master' into export-html
uliska Jul 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions annotate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ annotations are printed* (see `scholarly/annotate/config.ily`). At the beginning
the music document, we can tell *scholarLY* which types of documents to export:

```lilypond
\setOption scholarly.annotate.export-targets #'(plaintext latex)
\setOption scholarly.annotate.export-targets #'(plaintext html latex)
```

Those output files will automatically format annotations to be further processed by the
relevant programs. Currently, *plaintext* and *latex* are available, while other types
are on the wishlist (such as *scheme* and *markdown*).
relevant programs. Currently, *plaintext*, *latex* and *html* are available, while other types
are on the wishlist (such as *scheme*, *json* and *markdown*).

## Basic Syntax

Expand Down
104 changes: 104 additions & 0 deletions annotate/config.ily
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,25 @@
\registerOption scholarly.colorize ##t




%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Filenames to Export
%%%%%%%%%%%%%%%%%%%%%%%%
% default is <project-name>.annotations.<ext>
\registerOption scholarly.annotate.export.filenames
% <ext> <file name>
#`((html . "index.html") ;; html
(latex . default) ;; latex
(scheme . default) ;; scheme
(plaintext . default) ;; plaintext
)






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Handling of annotation types for plain text output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand All @@ -111,6 +130,91 @@
(question . "Question:")
(todo . "TODO:"))



%%%%%%%%%%%%%%%%%
%%%% HTML options
%%%%%%%%%%%%%%%%%

% Annotation types for html text output
\registerOption scholarly.annotate.export.html.labels
#`((critical-remark . "Critical Remark")
(musical-issue . "Musical Issue")
(lilypond-issue . "Lilypond Issue")
(question . "Question")
(todo . "TODO"))

% Print full document with header (including CSS link) and body, or just
% annotations div
\registerOption scholarly.annotate.export.html.full-document ##t


% 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 . 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
)

\registerOption scholarly.annotate.export.html.annotations-div-tags
#`((class . "my-annotations")
(id . #f))

% Which props to print to html
\registerOption scholarly.annotate.export.html.props
#`(type grob-location grob-type message)

% Which labels to print for props (only affect props included in previous list)
\registerOption scholarly.annotate.export.html.prop-labels
#`((type . "<em>Type:</em> ")
(grob-location . #f)
(grob-type . #f)
(message . #f))


% Which stylesheet to link, or print in header, or generate
% if the `use-css` is set to default, it will ignore whatever is here
% 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.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
% #`inline = embed css inline (very much not yet implemented)
% #`header = print in header;
% #`linked = link in header, which also means export css (default or generated)
\registerOption scholarly.annotate.export.html.with-css
#`linked


% 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 = (link to) external stylesheet (does not support *importing* yet)
\registerOption scholarly.annotate.export.html.use-css
#`default




% css settings for a generated file
% for linking, scholarLY converts this all into a css file and links to it
% for printing in header, we do the same but print into the header
% for embedded/inline css, scholarly sorts the option as best it can; if the
% options don't match the divs (say, we have a setting for "foo" class, but there
% is no "foo" class in the document), it is ignored.
\registerOption scholarly.annotate.export.html.generate-css-settings #`()




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Handling of annotation types for LaTeX output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down
Loading