Skip to content

Commit

Permalink
release v0.11.0
Browse files Browse the repository at this point in the history
Breaking changes:
- disable again mathMLSpacing option in MathJax due to poor results
- improve listings with line numbers (fix #25)
- only add --navigationtoc=context when using the GitBook style
- Docker container uses root again for compatibility with GitHub actions
- template GitHub workflow improvements (untested)
  • Loading branch information
xworld21 committed Oct 30, 2024
1 parent 250da5c commit ababd89
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
11 changes: 10 additions & 1 deletion CSS/style.gitbook.scss
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ mjx-container[jax="SVG"][display="true"] {
/* unset bookdown font size, restore spaces */
&>pre>code {
font-size: inherit;
white-space: pre;
white-space: normal;
display: block;
}

/* adjust position of download button */
Expand All @@ -406,6 +407,14 @@ mjx-container[jax="SVG"][display="true"] {
}
}

/* typeset line numbers within container */
.ltx_lst_numbers_left .ltx_listingline .ltx_tag {
position: initial;
display: inline-block;
margin-left: 0;
width: 1.7em;
}

.book .book-body .page-wrapper .page-inner section.normal {
& code.ltx_lstlisting {
font-size: inherit;
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,3 @@ EOF

WORKDIR /source
ENTRYPOINT ["/run-bookml"]
USER ubuntu
6 changes: 0 additions & 6 deletions XSLT/bookml-html5.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@
<xsl:text>&#x0A;</xsl:text>
<script>
MathJax = {
chtml: {
mathmlSpacing: true
},
svg: {
mathmlSpacing: true
},
startup: {
ready() {
// do not process equations disabled with \bmlDisableMathJax (code suggested by Davide P. Cervone)
Expand Down
5 changes: 5 additions & 0 deletions XSLT/proc-resources.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@
xmlns:ltx="http://dlmf.nist.gov/LaTeXML"
exclude-result-prefixes="ltx">

<xsl:import href="utils.xsl"/>

<xsl:output
method="text"
encoding="utf-8" />

<xsl:param name="BML_TARGET" />

<xsl:template match="/">
<xsl:if test="$BMLSTYLE='gitbook'">
<xsl:value-of select="$BML_TARGET" /><xsl:text>: LATEXMLPOSTAUTOFLAGS=--navigationtoc=context&#x0A;</xsl:text>
</xsl:if>
<xsl:apply-templates select="//ltx:resource" />
</xsl:template>

Expand Down
6 changes: 3 additions & 3 deletions bookml.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BookML: bookdown flavoured GitBook port for LaTeXML
# BookML: bookdown flavoured GitBook port for LaTeXML
# Copyright (C) 2021-23 Vincenzo Mantova <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -26,7 +26,7 @@ SYNCTEX ?= 5 # must produce *.synctex.gz
LATEXML ?= latexml
LATEXMLPOST ?= latexmlpost
LATEXMLFLAGS ?=
LATEXMLPOSTFLAGS ?= --urlstyle=file --navigationtoc=context --sourcedirectory=.
LATEXMLPOSTFLAGS ?= --urlstyle=file --sourcedirectory=.
# (4) for *adding* options without changing the default ones
LATEXMLEXTRAFLAGS ?=
LATEXMLPOSTEXTRAFLAGS ?= --pmml --mathtex
Expand Down Expand Up @@ -352,7 +352,7 @@ $(AUX_DIR)/html/%/index.html: $$(AUX_DIR)/xml/$$*.xml $$(BOOKML_DEPS_HTML) $$(wi
@$(if $(_recurse),,$(call bml.prog,latexmlpost: $*.xml → $*/index.html))
-@$(if $(_recurse),,$(call bml.cmd,$(RMDIR) $(call bml.ospath,$(AUX_DIR)/html/$*)))
@$(if $(_recurse),,$(call bml.cmd,$(LATEXMLPOST) $(if $(wildcard LaTeXML-html5.xsl),,--stylesheet=bookml/XSLT/bookml-html5.xsl) \
$(if $(SPLITAT),--splitat=$(SPLITAT)) --xsltparameter=BMLSEARCH:yes $(LATEXMLPOSTFLAGS) $(LATEXMLPOSTEXTRAFLAGS) \
$(if $(SPLITAT),--splitat=$(SPLITAT)) --xsltparameter=BMLSEARCH:yes $(LATEXMLPOSTAUTOFLAGS) $(LATEXMLPOSTFLAGS) $(LATEXMLPOSTEXTRAFLAGS) \
--dbfile=$(AUX_DIR)/latexmlaux/"$*".LaTeXML.db --log="$(AUX_DIR)/latexmlaux/$*.latexmlpost.log" --destination="$@" "$<"))
@$(if $(_recurse),,$(call bml.cmd,$(PERL) bookml/search_index.pl "$(AUX_DIR)/html/$*"))

Expand Down
11 changes: 7 additions & 4 deletions template/.github/workflows/bookml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ jobs:
- name: Check out LaTeX files
uses: actions/checkout@v4
- name: Compile with BookML
id: bookml
# you may replace bookml with bookml-basic, bookml-small, bookml-medium to download fewer packages
uses: docker://ghcr.io/vlmantova/bookml:latest
with:
args: all aux-zip
args: all aux-zip # warning: aux-zip must be run *sequentially after* all
- name: Upload outputs
if: ${{ always() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
title: ${{ github.run_number }}
run: gh release create "${{ github.ref_name }}" --repo="$GITHUB_REPOSITORY" --title="build $title" --notes="${{ github.event.head_commit.message }}" --draft *.zip
notes: ${{ steps.bookml.outcome == 'cancelled' && '**The build was cancelled. Some outputs may be missing.** ' || ( steps.bookml.outcome == 'failure' && '**Parts of the build have failed. Consult the AUX file for more information.** ' || '' ) }}${{ github.event.head_commit.message }}
title: ${{ steps.bookml.outcome == 'cancelled' && 'cancelled' || ( steps.bookml.outcome == 'failure' && 'failed' || 'successful' ) }} build ${{ github.event.head_commit.message }}
ref: ${{ github.ref_name }}
run: gh release create "$ref" --repo="$GITHUB_REPOSITORY" --title="$title" --notes="$notes" *.zip

0 comments on commit ababd89

Please sign in to comment.