Skip to content

Commit

Permalink
Sass Tweaks
Browse files Browse the repository at this point in the history
Tweak the Sass build script in view of the upcoming Rouge integration.
Now the generated docinfo file for Highlight is named `docinfo_HL.html`
in the Sass folder, and deployed as `docinfo.html` in its dest folders.
  • Loading branch information
tajmone committed Jul 30, 2021
1 parent 84509f8 commit d7f2ef5
Show file tree
Hide file tree
Showing 3 changed files with 228 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## ===============
*.html
*.pdf
! docinfo.html
!docinfo.html
!/_assets-src/original-docs/**.html
!/_assets-src/original-docs/**.pdf
# DocBook intermediate file used in the PDF conversion:
Expand Down
33 changes: 20 additions & 13 deletions _assets-src/sass/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# "build.sh" v1.0.0 | 2021/05/24 | by Tristano Ajmone
# "build.sh" v1.1.0 | 2021/07/30 | by Tristano Ajmone
# ------------------------------------------------------------------------------
# This script requires Dart Sass to be installed on the system:
# https://github.com/sass/dart-sass
Expand All @@ -9,29 +9,36 @@
# https://chocolatey.org/packages/sass
# ------------------------------------------------------------------------------

# Build highlight.js stylesheet
###############################
sass highlight-js.scss ../../_assets/hjs/styles/github.min.css
rm -f *.css docinfo*.html

# Build Highlight stylesheet
############################
## Build CSS Stylesheets
########################
sass highlight-js.scss ../../_assets/hjs/styles/github.min.css
sass highlight.scss highlight.css

# Create docinfo file from CSS:
## Create docinfo Files from CSS
################################

echo "<style>" > docinfo.html
cat highlight.css >> docinfo.html
echo "</style>" >> docinfo.html
echo "<style>" > docinfo_HL.html
cat highlight.css >> docinfo_HL.html
echo "</style>" >> docinfo_HL.html


if [[ $(uname -s) == MINGW* ]];then
unix2dos docinfo.html
unix2dos docinfo*.html
fi

# Deploy docinfo file to dest folders (can't be used via relative paths):
## Deploy docinfo Files to Dest Folders
#######################################

# docinfo files can't be used via relative paths!

# =========
# Highlight
# =========

DestDirs="alanguide conversion"
for folder in ${DestDirs[*]} ; do
echo "../../$folder/"
cp docinfo.html "../../$folder/"
cp docinfo_HL.html "../../$folder/docinfo.html"
done
207 changes: 207 additions & 0 deletions conversion/docinfo.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d7f2ef5

Please sign in to comment.