Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Add theme comments, add document metadata

AuthorDaveJarvis <email>
Date2021-04-16 19:37:27 GMT-0700
Commit475714f1488249ac837ecc11c2d4223fc09038de
Parent74c5c62
src/main/java/com/keenwrite/preferences/PreferencesController.java
private Category[] createCategories() {
- return new Category[]{Category.of(
- get( KEY_R ),
- Group.of(
- get( KEY_R_DIR ),
- Setting.of( label( KEY_R_DIR,
- stringProperty( KEY_DEF_DELIM_BEGAN ).get(),
- stringProperty( KEY_DEF_DELIM_ENDED ).get() ) ),
- Setting.of( title( KEY_R_DIR ),
- fileProperty( KEY_R_DIR ), true )
+ return new Category[]{
+ Category.of(
+ get( KEY_DOC ),
+ Group.of(
+ get( KEY_DOC_TITLE ),
+ Setting.of( label( KEY_DOC_TITLE ) ),
+ Setting.of( title( KEY_DOC_TITLE ),
+ stringProperty( KEY_DOC_TITLE ) )
+ ),
+ Group.of(
+ get( KEY_DOC_AUTHOR ),
+ Setting.of( label( KEY_DOC_AUTHOR ) ),
+ Setting.of( title( KEY_DOC_AUTHOR ),
+ stringProperty( KEY_DOC_AUTHOR ) )
+ )
),
- Group.of(
- get( KEY_R_SCRIPT ),
- Setting.of( label( KEY_R_SCRIPT ) ),
- createScriptSetting()
+ Category.of(
+ get( KEY_TYPESET ),
+ Group.of(
+ get( KEY_TYPESET_CONTEXT ),
+ Setting.of( label( KEY_TYPESET_CONTEXT_PATH ) ),
+ Setting.of( title( KEY_TYPESET_CONTEXT_PATH ),
+ fileProperty( KEY_TYPESET_CONTEXT_PATH ), true ),
+ Setting.of( label( KEY_TYPESET_CONTEXT_ENV ) ),
+ Setting.of( title( KEY_TYPESET_CONTEXT_ENV ),
+ stringProperty( KEY_TYPESET_CONTEXT_ENV ) )
+ )
),
- Group.of(
- get( KEY_R_DELIM_BEGAN ),
- Setting.of( label( KEY_R_DELIM_BEGAN ) ),
- Setting.of( title( KEY_R_DELIM_BEGAN ),
- stringProperty( KEY_R_DELIM_BEGAN ) )
+ Category.of(
+ get( KEY_R ),
+ Group.of(
+ get( KEY_R_DIR ),
+ Setting.of( label( KEY_R_DIR,
+ stringProperty( KEY_DEF_DELIM_BEGAN ).get(),
+ stringProperty( KEY_DEF_DELIM_ENDED ).get() ) ),
+ Setting.of( title( KEY_R_DIR ),
+ fileProperty( KEY_R_DIR ), true )
+ ),
+ Group.of(
+ get( KEY_R_SCRIPT ),
+ Setting.of( label( KEY_R_SCRIPT ) ),
+ createScriptSetting()
+ ),
+ Group.of(
+ get( KEY_R_DELIM_BEGAN ),
+ Setting.of( label( KEY_R_DELIM_BEGAN ) ),
+ Setting.of( title( KEY_R_DELIM_BEGAN ),
+ stringProperty( KEY_R_DELIM_BEGAN ) )
+ ),
+ Group.of(
+ get( KEY_R_DELIM_ENDED ),
+ Setting.of( label( KEY_R_DELIM_ENDED ) ),
+ Setting.of( title( KEY_R_DELIM_ENDED ),
+ stringProperty( KEY_R_DELIM_ENDED ) )
+ )
),
- Group.of(
- get( KEY_R_DELIM_ENDED ),
- Setting.of( label( KEY_R_DELIM_ENDED ) ),
- Setting.of( title( KEY_R_DELIM_ENDED ),
- stringProperty( KEY_R_DELIM_ENDED ) )
- )
- ),
Category.of(
get( KEY_IMAGES ),
localeListProperty(),
localeProperty( KEY_LANGUAGE_LOCALE ) )
- )
- ),
- Category.of(
- get( KEY_TYPESET ),
- Group.of(
- get( KEY_TYPESET_CONTEXT ),
- Setting.of( label( KEY_TYPESET_CONTEXT_PATH ) ),
- Setting.of( title( KEY_TYPESET_CONTEXT_PATH ),
- fileProperty( KEY_TYPESET_CONTEXT_PATH ), true ),
- Setting.of( label( KEY_TYPESET_CONTEXT_ENV ) ),
- Setting.of( title( KEY_TYPESET_CONTEXT_ENV ),
- stringProperty( KEY_TYPESET_CONTEXT_ENV ) )
)
)};
src/main/java/com/keenwrite/preferences/Workspace.java
import static com.keenwrite.Bootstrap.APP_TITLE_LOWERCASE;
-import static com.keenwrite.constants.Constants.*;
import static com.keenwrite.Launcher.getVersion;
+import static com.keenwrite.constants.Constants.*;
import static com.keenwrite.events.StatusEvent.clue;
import static com.keenwrite.preferences.WorkspaceKeys.*;
+import static java.lang.System.getProperty;
import static java.util.Map.entry;
import static javafx.application.Platform.runLater;
entry( KEY_META_VERSION, asStringProperty( getVersion() ) ),
entry( KEY_META_NAME, asStringProperty( "default" ) ),
-
+
+ entry( KEY_DOC_TITLE, asStringProperty( "title" ) ),
+ entry( KEY_DOC_AUTHOR, asStringProperty( getProperty( "user.name" ) ) ),
+
entry( KEY_R_SCRIPT, asStringProperty( "" ) ),
entry( KEY_R_DIR, asFileProperty( USER_DIRECTORY ) ),
src/main/java/com/keenwrite/preferences/WorkspaceKeys.java
public static final Key KEY_META_VERSION = key( KEY_META, "version" );
+ public static final Key KEY_DOC = key( KEY_ROOT, "document" );
+ public static final Key KEY_DOC_TITLE = key( KEY_DOC, "title" );
+ public static final Key KEY_DOC_AUTHOR = key( KEY_DOC, "author" );
+
public static final Key KEY_R = key( KEY_ROOT, "r" );
public static final Key KEY_R_SCRIPT = key( KEY_R, "script" );
src/main/resources/com/keenwrite/messages.properties
# ########################################################################
+workspace.document=Document
+workspace.document.author=Author Name
+workspace.document.author.desc=Full name of primary author.
+workspace.document.author.title=Author
+workspace.document.title=Title Name
+workspace.document.title.desc=Full document title.
+workspace.document.title.title=Title
+
workspace.r=R
workspace.r.script=Startup Script
workspace.ui.skin=Skins
workspace.ui.skin.selection=Bundled
-workspace.ui.skin.selection.desc=Pre-packaged application style (default: Modena Light)
+workspace.ui.skin.selection.desc=Pre-packaged application style (default: Modena Light).
workspace.ui.skin.selection.title=Name
workspace.ui.skin.custom=Custom
-workspace.ui.skin.custom.desc=User-defined JavaFX cascading stylesheet file
+workspace.ui.skin.custom.desc=User-defined JavaFX cascading stylesheet file.
workspace.ui.skin.custom.title=Path
workspace.typeset.context=ConTeXt
workspace.typeset.context.path=Paths
-workspace.typeset.context.path.desc=Comma-separated directories containing support files
-workspace.typeset.context.path.title=Directories
+workspace.typeset.context.path.desc=Comma-separated directories containing theme support files.
+workspace.typeset.context.path.title=Theme
workspace.typeset.context.environment=Environments
-workspace.typeset.context.environment.desc=Comma-separated environment file names
+workspace.typeset.context.environment.desc=Comma-separated environment file names.
workspace.typeset.context.environment.title=Files
themes/boschet/figures.tex
-\unprotect
-\appendtoks
- \setupbackgrounds[\v!page][\c!background=\makeupparameter\c!background]
-\to \t_page_makeup_every_setup
-\protect
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Configure how images are presented
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setupexternalfigures[
order={svg,pdf,png},
location={local,default,global},
directory={screens,graphs},
frame=on,
framecolor=TextColourTertiaryLt,
- rulethickness=1pt,
+ rulethickness=.5pt,
frameoffset=.5em,
maxwidth=\makeupwidth,
width=\makeupwidth,
]
\setupcaptions[
- %inbetween={\blank[big]},
+ location=none,
]
themes/boschet/fonts.tex
\definefontfamily [TextFont] [ss] [Archivo Narrow]
\definefontfamily [TextFont] [tt] [Inconsolata]
+\definefontfamily [TextFont] [mm] [TeX Gyre Pagella Math]
\setupbodyfont[TextFont]
themes/boschet/headings.tex
\stopuseMPgraphic
-%\definecolor[ChapterNumberColour][h=A1C436]
\definecolor[ChapterNumberColour][white]
\setuphead[section][
+ number=no,
style=SectionFont,
]
\setuphead[subsection][
+ number=no,
style=SubSectionFont,
]
themes/boschet/main.tex
\setuppapersize[letter]
-\input modules
\input constants
\input makeups
\input paragraphs
+\input quotations
\input figures
\input tables
themes/boschet/modules.tex
-\usemodule[bib]
-\usemodule[vim]
-\usesymbols[nav]
-
themes/boschet/pages.tex
]
-\setupwhitespace[medium]
-
\setupheadertexts[\WPheaderchapter][\WPheadertitle][\WPheadertitle][\WPheaderchapter]
themes/boschet/quotations.tex
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Configure how quotations are presented
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\define\TextQuotationBefore{\blank\startnarrower}
+\define\TextQuotationAfter{\stopnarrower\blank}
+
+\setupdelimitedtext[quotation][
+ before=\TextQuotationBefore,
+ after=\TextQuotationAfter,
+]
+
themes/boschet/rules.tex
\define\thinrule{%
- \startalignment[middle]
\blank
+ \startalignment[middle]
\dorecurse{3}{\hspace[TextRuleSpace]\symbol[star]\hspace[TextRuleSpace]}
- \blank
\stopalignment
+ \blank
+ \noindentation
}
themes/xhtml/setups.tex
\startxmlsetups xml:xhtml
- % Do not typeset the HTML document's header title element
+ % Prevent typsetting elements not declared in this file.
\xmlsetsetup{\xmldocument}{*}{-}
% Document elements
\xmlsetsetup{\xmldocument}{html|body}{xml:*}
+
+ % Meta information (author, title, date, copyright, keywords)
+ \xmlsetsetup{\xmldocument}{head}{xml:meta}
% Header elements
themes/xhtml/xml-blocks.tex
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Map HTML block-level elements to macros
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
% Paragraphs are followed by a paragraph break.
\startxmlsetups xml:p
themes/xhtml/xml-breaks.tex
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Map break elements to macros
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\startxmlsetups xml:hr
\thinrule
themes/xhtml/xml-document.tex
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Map high-level document elements to macros
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\startxmlsetups xml:html
\xmlflush{#1}
themes/xhtml/xml-entities.tex
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% Map XHTML document entities to ConTeXt symbols and TeX macros
+% Map document entities to symbols and macros
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
themes/xhtml/xml-headings.tex
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Map heading levels to macros
+%
+% Headings relate ideas to guide readers through chapters. When nested too
+% deeply, they tend to confuse rather than clarify. Most books need no more
+% three levels.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\startxmlsetups xml:h1
\chapter{\xmlflush{#1}}
themes/xhtml/xml-inline.tex
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Map inline elements to macros
+%
+% Underlines are undefined. Early typewriters used monospaced fonts that
+% presented evenly-spaced characters, and had a limited character set. Such
+% limitations were found in early computers, though the technological reasons
+% differ. Italic text can be typeset more closely while retaining legibility
+% at smaller sizes; in early printing, italics provided a way to set off
+% sections of text. Typewriters and early computers didn't offer italics,
+% and by 1881 the underscore key became a fixture to work around connecting
+% text on machines that lacked italics.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\startxmlsetups xml:img
\starttexcode
themes/xhtml/xml-lists.tex
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Map ordered (enumerated) and unordered (bullet) lists to macros
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\startxmlsetups xml:ol
\startitemize[n]
themes/xhtml/xml-meta.tex
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Map metadata to front matter macros
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\startxmlsetups xml:meta
+ \startfrontmatter
+ \placecontent
+ \stopfrontmatter
+\stopxmlsetups
+
themes/xhtml/xml-table.tex
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Map table elements to extreme table (xtable) macros
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\startxmlsetups xml:table
- \blank[medium]
+ \blank
\startembeddedxtable
\xmlflush{#1}
\stopembeddedxtable
- \blank[medium]
+ \blank
\stopxmlsetups
\stopxmlsetups
+% When the XHTML table lacks a tfoot element, treat the last table row
+% in the body as part of the footer, which may be styled independently.
\startxmlsetups xml:tr:last
\stopxtablebody
themes/xhtml/xml-tex.tex
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Maps TeX elements (e.g., $..$) to ConTeXt macros
+
+% This is required because inline elements within block elements cannot be
+% passed to \flushcontext. Thus any TeX code must be handled as a separate
+% TeX element.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\startxmlsetups xml:tex
\xmlflushcontext{#1}
Delta190 lines added, 65 lines removed, 125-line increase