Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
clsource committed Oct 10, 2024
1 parent 9627ac6 commit 03aaf49
Show file tree
Hide file tree
Showing 2,750 changed files with 448,155 additions and 22,266 deletions.
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ indent_size = 2
indent_style = space
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf

[{*.adoc, *.md}]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
indent_style = tab
6 changes: 5 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
$ cat .gitattributes
* text=auto
* text=auto eol=lf
*.dbml linguist-language=JavaScript
*.dbml linguist-vendored
*.bpmn linguist-language=XML
*.bpmn linguist-vendored
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
.DS_Store
.asciidoctor
.vscode
.idea
node_modules/
dbml-error.log
6 changes: 0 additions & 6 deletions .tool-versions

This file was deleted.

45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# See https://docs.asciidoctor.org/diagram-extension/latest/
# Tested on asciidoctor/docker-asciidoctor:1.78
FROM asciidoctor/docker-asciidoctor:latest

# Image comes with PlantUML and Grahpviz by default
# Add renderers of additional diagram languages

# Add dependencies
RUN apk add --update neovim nodejs npm
RUN apk add --no-cache \
build-base \
g++ \
cairo-dev \
jpeg-dev \
giflib-dev \
libpng-dev \
pango-dev \
bash \
imagemagick

# TODO: Consider installing bibtex for using: asciidoctor -r asciidoctor-bibtex

# DBML
# Since making ERD with PlantUML is cumbersome
RUN npm install -g @dbml/cli
RUN npm install -g @softwaretechnik/dbml-renderer

# Note Mermaid and BPMN needs Puppeteer
# So they are ommited for now in the default config

# BPMN
# Since making BPMN with PlantUML is not supported
# RUN npm install -g bpmn-js-cmd

# Mermaid for additional diagrams
# RUN npm install -g @mermaid-js/mermaid-cli

# Vega
# For making charts and graphs
RUN npm install --build-from-source -g vega-cli vega vega-lite vega-embed

WORKDIR /documents
VOLUME /documents

CMD ["/bin/bash"]
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
These documents are licensed with Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International

Unless explicitly specified source code Licensed with BSD-2.
11 changes: 0 additions & 11 deletions LICENSE.adoc

This file was deleted.

56 changes: 23 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,45 +1,35 @@
.PHONY: html docbook pdf epub word build clean update

# TODO: Consider Docker https://github.com/asciidoctor/docker-asciidoctor

build b:
@make clean
@make html
@make docbook
@make pdf
@make word
@make epub
.PHONY: html pdf server install bash word docbook docs

html h:
@rm -rf docs/index.html
@mkdir -p docs/book/assets
@cp -R assets/highlight docs/
@cp -R book/assets docs/book

asciidoctor book.adoc -o docs/index.html

docbook d:
@mkdir -p docs
@rm -rf docs/book.xml
asciidoctor -a media=prepress -b docbook book.adoc -o docs/book.xml
@rm -rf docs/html
@mkdir -p docs/html
@cp -r resources/ docs/html
@docker run -it -u $(id -u):$(id -g) -v .:/documents/ adoc-book asciidoctor -r asciidoctor-diagram book.adoc -o docs/html/index.html --verbose

pdf p:
@mkdir -p docs
@rm -rf docs/book.pdf
asciidoctor-pdf -a allow-uri-read=true -a source-highlighter=rouge -a rouge-style=monokai_sublime book.adoc -o docs/book.pdf
@make docs
@docker run -it -u $(id -u):$(id -g) -v .:/documents/ adoc-book asciidoctor-pdf -a allow-uri-read=true -a source-highlighter=rouge -a rouge-style=monokai_sublime -r asciidoctor-diagram -r asciidoctor-mathematical -a mathematical-format=svg book.adoc -o docs/book.pdf --verbose

epub e:
@mkdir -p docs
@rm -rf docs/book.epub
@cd docs && pandoc --from docbook --to epub --output book.epub book.xml
server s:
@cd docs/html && echo "http://localhost:8000" && python3 -m http.server

clean c:
@rm -rf docs
# Enter the server inside Docker
bash:
@docker run -it -u $(id -u):$(id -g) -v .:/documents/ adoc-book /bin/bash

update u:
@./update.sh
install i:
@docker build -t adoc-book .

word w:
docs:
@mkdir -p docs

docbook d:
@make docs
@rm -rf docs/book.xml
@docker run -it -u $(id -u):$(id -g) -v .:/documents/ adoc-book asciidoctor -b docbook -r asciidoctor-diagram -r asciidoctor-mathematical -a mathematical-format=svg -a media=prepress book.adoc -o docs/book.xml --verbose

word w:
@make docs
@rm -rf docs/book.docx
@cd docs && pandoc --from docbook --to docx --output book.docx book.xml
58 changes: 41 additions & 17 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,36 +1,60 @@
:toc: macro
:toc-title: Tabla de Contenidos
:toclevels: 3
:fn-ninjas: footnote:[https://ninjas.cl]

# Libro de Ejemplo
= Asciidoc Book Template

Esta es una plantilla para escribir más libros.
Viene con los comandos básicos en el _Makefile_.
This is an example template for making _Asciidoc_ books.

Escrito por https://ninjas.cl[Camilo Castro] y https://github.com/ninjascl/asciidoc-book-template/graphs/contributors[colaboradores]. Para https://ninjas.cl[Ninjas.cl].
An example output can be seen online at https://ninjascl.github.io/asciidoc-book-template/.

## https://ninjascl.github.io/asciidoc-book-template/[Leer Online]
You can learn with https://github.com/powerman/asciidoc-cheatsheet[Asciidoc Cheatsheet].

Este libro puede ser leido gratuitamente en https://ninjascl.github.io/asciidoc-book-template/.
== Technology

## Licencia
- https://www.docker.com/
- https://docs.asciidoctor.org/
- Python3 (Webserver)
- https://pandoc.org/ (Conversion to multiple formats)

### Documento
=== Diagrams

Esta obra está bajo una http://creativecommons.org/licenses/by-nc-sa/4.0/[Licencia Creative Commons Atribución-No-Comercial-Compartir-Igual 4.0 Internacional]
Using the base Dockerfile for https://docs.asciidoctor.org/diagram-extension/latest/

http://creativecommons.org/licenses/by-nc-sa/4.0/[image:https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png[Licencia Creative Commons]]
The following technologies were selected for diagrams:

### Código Fuente
- https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/plantuml/[PlantUML]: UML diagrams and C4 architecture diagrams.
- https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/graphviz/[Graphviz]: Generic diagrams tool.
- https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/dbml/[DBML]: Database ERD diagrams (friendlier syntax than PlantUML)
- https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/vega/[Vega]: Declarative language for creating, saving, and sharing interactive visualization designs.

A menos que se especifique explícitamente, el código fuente esta bajo una licencia https://opensource.org/licenses/BSD-2-Clause[BSD-2].
.WIP Diagrams
These need extra configurations inside the Dockerfile to Work (Puppeteer).

- https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/mermaid/[Mermaid]: Uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams.
- https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/bpmn/[BMPN]: Business Process Model and Notation.

## 🤩 Créditos
== Commands

- `make install`: Builds the Dockerfile.
- `make html`: Builds the html version of the book.
- `make pdf`: Builds a PDF version of the book.
- `make server`: Starts a new server for the html version. (requires python3).
- `make word`: Creates a new Microsoft Word document from the book. (requires pandoc).

== License

Created with ❤️ by https://ninjas.cl[Camilo Castro] and https://github.com/ninjascl/asciidoc-book-template/graphs/contributors[contributors]footnote:[https://github.com/ninjascl/asciidoc-book-template/graphs/contributors]. for https://ninjas.cl[Ninjas.cl]{fn-ninjas}.

This document is licensed with http://creativecommons.org/licenses/by-nc-sa/4.0/[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International]footnote:[http://creativecommons.org/licenses/by-nc-sa/4.0/]

http://creativecommons.org/licenses/by-nc-sa/4.0/[image:resources/images/by-nc-sa.svg[Licencia Creative Commons]]

Source code licensed with https://opensource.org/licenses/BSD-2-Clause[BSD-2]footnote:[https://opensource.org/licenses/BSD-2-Clause].

## 🤩 Credits

++++
<p>
Hecho con <i class="fa fa-heart">&#9829;</i> por
Made with <i class="fa fa-heart">&#9829;</i> by
<a href="https://ninjas.cl">
Ninjas.cl
</a>.
Expand Down
Loading

0 comments on commit 03aaf49

Please sign in to comment.