Skip to content

Commit

Permalink
Convert to Asciidoctor sources. (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot authored Nov 15, 2024
1 parent d5b375c commit 1399099
Show file tree
Hide file tree
Showing 54 changed files with 3,667 additions and 666 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
run: sudo apt-get update

- name: Install (APT)
run: sudo apt-get install latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended lmodern
run: sudo apt-get install latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended lmodern asciidoctor

- name: Install (B2)
run: |
set -e
pushd ..
wget "https://github.com/bfgroup/b2/archive/release.zip" -O b2.zip
wget "https://github.com/bfgroup/b2/archive/main.zip" -O b2.zip
unzip b2.zip
cd b2-release
cd b2-main
CXX= ./bootstrap.sh
CXX= sudo ./b2 install b2-install-layout=portable --prefix=/usr/bin
popd
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,31 @@ concurrency:
jobs:
# Single deploy job since we're just deploying
deploy:
if: github.repository == 'cplusplus/ecosystem-is'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Update APT Cache
run: sudo apt-get update
- name: Install (APT)
run: sudo apt-get install asciidoctor
- name: Install (B2)
run: |
set -e
pushd ..
wget "https://github.com/bfgroup/b2/archive/main.zip" -O b2.zip
unzip b2.zip
cd b2-main
CXX= ./bootstrap.sh
CXX= sudo ./b2 install b2-install-layout=portable --prefix=/usr/bin
popd
- name: Build (Web)
run: |
b2 --debug-configuration -d+2 ecosystem-pub
- name: Setup Pages
uses: actions/configure-pages@main
- name: Upload artifact
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,6 @@ report/*.html

# Build dirs
/.build

/ecosystem-is-*.*
/pub/index.html
30 changes: 11 additions & 19 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ involved in the development you can:

== Getting Started

=== Asciidoctor

You'll need the latest https://asciidoctor.org/[Asciidoctor] version 2. Consult
their https://asciidoctor.org/#installation[installation] instructions for ways
to obtain it.

=== B2

The https://www.bfgroup.xyz/b2/[B2] build system is needed to manage the
translation steps from the Asciidoctor sources, to LaTex+PDF and to HTML.

=== LaTeX

You'll need a sufficiently recent and capable LaTeX distribution installed and
Expand Down Expand Up @@ -69,22 +80,3 @@ you have the appropriate LaTeX tools installed and accessible vscode will
automatically build a PDF you can preview in vscode and edit `tex` files
semi-live. The resulting built files and PDF are placed in the
`${workspaceFolder}/.build/vscode` directory.

=== B2

You can use the https://www.bfgroup.xyz/b2/[B2 build system] which has more
ways to build the documents. Obviously you'll need to install LaTeX as above.
And of course also install B2, if you don't already have it. Then you can just
do: `b2` at the root to produce the default draft PDF.

=== Manual

It's also possible to directly build the PDF doc from the command line:

[source,shell]
----
cd src
latexmk -pdf ecosystem.tex
----

Which will produce many files and a `ecosystem.pdf` result in the current dir.
75 changes: 36 additions & 39 deletions build.jam
Original file line number Diff line number Diff line change
@@ -1,65 +1,62 @@
#|
Copyright René Ferdinand Rivera Morell
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
|#

require-b2 5.3 ;

import toolset ;
import feature ;

feature.feature doc-stage : draft final : propagated symmetric ;
feature.feature doc-stage : draft final web : propagated symmetric ;
feature.feature verbose : off on : propagated incidental ;
feature.feature license : off on : propagated symmetric ;

project /ecosystem
project /cplusplus/ecosystem-is
: build-dir .build/b2
: default-build <doc-stage>draft <license>off <verbose>on
;

local tex-src = [ glob src/eco_*.tex src/in_*.tex src/*.ist ] ;
local latexmkrc = [ glob src/*latexmkrc* ] ;
local _ = " " ;

rule latex-defs ( properties * )
rule install-name-pdf ( properties * )
{
local pretex ;
if <doc-stage>final in $(properties)
{
pretex += "\\\\def\\\\isofinal{yes}" ;
}
if <license>on in $(properties)
{
pretex += "\\\\def\\\\license{yes}" ;
}
return <flags>"-usepretex=\"$(pretex:J= )\"" ;
local name = ecosystem-is ;
if <doc-stage>draft in $(properties) { name += draft ; }
if <doc-stage>final in $(properties) { name += final ; }
if <license>on in $(properties) { name += ccby4 ; }
return <name>$(name:J=-).pdf ;
}

make ecosystem.pdf : src/ecosystem.tex
: @latexmk
: <dependency>$(tex-src)
<verbose>on:<flags>-verbose
<verbose>on:<flags>-diagnostics
<flags>-r$(_)"$(latexmkrc[1])"
<conditional>@latex-defs
install ecosystem-is-latex-pdf
: src//ecosystem.pdf
: <location>.
<conditional>@install-name-pdf
<relevant>doc-stage
<relevant>license
;
explicit ecosystem.pdf ;

rule install-name ( properties * )
rule install-name-html ( properties * )
{
local name = ecosystem-is ;
if <doc-stage>draft in $(properties) { name += draft ; }
if <doc-stage>final in $(properties) { name += final ; }
if <license>on in $(properties) { name += ccby4 ; }
return <name>$(name:J=-).pdf ;
return <name>$(name:J=-).html ;
}

install ecosystem-is
: ecosystem.pdf
install ecosystem-is-adoc-html
: src//ecosystem.html
: <location>.
<conditional>@install-name
<conditional>@install-name-html
<relevant>doc-stage
<relevant>license
;

# Generic latexmk action.

toolset.flags $(__name__).latexmk FLAGS <flags> ;

actions latexmk
{
export TEXINPUTS="$(>:D):${TEXINPUTS}"
latexmk -f -pdf -interaction=nonstopmode -logfilewarnings- -shell-escape -gg -outdir="$(<:D)" -auxdir="$(<:D)" -makeindexfudge $(FLAGS) "$(>:D=)"
}
install ecosystem-pub
: src//ecosystem.html/<doc-stage>web/<license>on
: <location>pub
<name>index.html
<relevant>doc-stage
<relevant>license
;
2 changes: 1 addition & 1 deletion pub/std_info-1.0.0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cplusplus.github.io/ecosystem-is/std_info-1.0.0.json",
"$id": "std_info-1.0.0.json",
"title": "Tool Introspection Version 1.0.0 JSON Schema",
"$defs": {
"VersionMin": {
Expand Down
83 changes: 83 additions & 0 deletions pub/std_param-1.0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "std_param-1.0.0.json",
"title": "Structured Parameters Version 1.0.0 JSON Schema",
"type": "object",
"properties": {
"$schema": {
"description": "JSON Schema URI for the version of the structured parameters format.",
"type": "string",
"format": "uri"
},
"version": {
"description": "The Structured Parameters format version.",
"type": "string",
"$ref": "#/$defs/Version"
},
"arguments": {
"description": "Application direct arguments.",
"type": "array",
"items": {
"type": "string"
}
},
"options": {
"description": "Application structured options.",
"type": "object",
"allOf": [
{
"$ref": "#/$opt/Std.Param"
}
],
"propertyName": {
"$ref": "#/$defs/Name"
}
}
},
"oneOf": [
{
"required": ["arguments"]
},
{
"required": ["options"]
}
],
"$defs": {
"Version": {
"type": "string",
"pattern": "^[0-9]+([.][0-9]+){0,2}$"
},
"Name": {
"type": "string",
"pattern": "^([a-z0-9_-]+[.])*([a-z0-9_-]+)$"
},
"StringOrArray": {
"type": ["string", "array"],
"items": {
"type": "string"
}
}
},
"$opt": {
"Std.Param": {
"properties": {
"std.param": {
"description": "Recursive reference to one or more structured parameters files.",
"type": "object",
"properties": {
"pre": {
"$ref": "#/$defs/StringOrArray"
},
"post": {
"$ref": "#/$defs/StringOrArray"
}
},
"additionalProperties": false
}
},
"param": {
"$ref": "#/$opt/Std.Param/properties/std.param"
}
}
}
}
19 changes: 19 additions & 0 deletions src/asciidoctor-latexcore/build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#|
Copyright René Ferdinand Rivera Morell
Distributed under the Boost Software License, Version 1.0.
(See copy at http://www.boost.org/LICENSE_1_0.txt)
|#

require-b2 5.2 ;

project /grafikrobot/asciidoctor-latexcore ;

path-constant here : . ;

alias latexcore
: usage-requirements
<asciidoctor-latexcore.flags>"-r $(here)/latexcore.rb"
<asciidoctor-latexcore.flags>"-b latexcore"
<dependency>latexcore.rb
;
explicit latexcore ;
Loading

0 comments on commit 1399099

Please sign in to comment.