Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting docs to asciidoctor #100

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions asciidoc/DC-edge
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Elemental on OSX on Apple Silicon (UTM)
#

# Sources
MAIN=edge.adoc
SRC_DIR=edge-book
IMG_SRC_DIR=images


# ASCIIDoc options
ADOC_POST=yes
ADOC_TYPE=book

# Stylesheets
STYLEROOT="/usr/share/xml/docbook/stylesheet/suse2022-ns"
FALLBACK_STYLEROOT="/usr/share/xml/docbook/stylesheet/suse-ns"

# DocBook Validation
DOCBOOK5_RNG_URI="http://docbook.org/xml/5.0/rng/docbookxi.rng"
86 changes: 86 additions & 0 deletions asciidoc/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
= SUSE Edge docmentation

ifdef::env-github[]
:imagesdir: images/
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

Welcome to the SUSE Edge documentation repository.

== Asciidoctor resources

Official documentation::
+
* https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/[Quick reference]
* https://github.com/uyuni-project/uyuni-docs/wiki/asciidoc-getting-started[Getting
Started]
* https://github.com/powerman/asciidoc-cheatsheet[Cheat sheet]
* https://docs.asciidoctor.org/asciidoc/latest/[Asciidoc language documentation]
+
Examples (refer to `raw` version for code)::
+
* https://github.com/openSUSE/daps/blob/main/test/documents/adoc/part_inlines.adoc[Inline
elements]
* https://github.com/openSUSE/daps/blob/main/test/documents/adoc/part_inlines.adoc[Block elements]


== Editing & Previewing

The documenation is written in Asciidoc(tor). Start with a very basic link:teamplate.adoc[Template].

* Sources can be directly edited and previewed in GitHub.
* If you edit your docs locally
** https://docs.asciidoctor.org/asciidoctor/latest/tooling/#web-browser-add-ons-preview-only[Preview add-ons for Web browsers]
** https://docs.asciidoctor.org/asciidoctor/latest/tooling/#ides-and-text-editors[IDEs and text editors]
** There also is asciidoc modes for emacs and vi ;-)


== Building the SUSE branded version locally

To build the documentation locally in the format it will get published, use https://github.com/openSUSE/daps2docker[daps2docker]
Note that doing these builds is not needed to check your contributions.
As long as your document renders fine in previews you are good.


.Requirements
* make sure your workstation is running docker or podman
* make sure your user can start containers
* install daps2docker from https://download.opensuse.org/repositories/Documentation:/Tools/
* navigate to the local checkout of this repository into the documentatio directory

Building HTML::
`daps2docker DC-edge html`
Building Single HTML::
`daps2docker DC-edge single-html`
Building PDF::
`daps2docker DC-edge pdf`

[TIP]
.Using Podman
====
By default, daps2docker uses docker as its container engine.
To use podman, export the environment variable CONTAINER_ENGINE=podman: `export CONTAINER_ENGINE=podman`
====

[TIP]
.Build errors
====
daps2docker builds documentation from DocBook XML sources.
Asciidoctor comes with a built-in converter to DocBook.

Asciidoc(tor) is way more forgiving than DocBook when it comes to validation.
In some cases, valid asciidoc source code does not validate when converting it
to DocBook.
In such a case building with daps2docker will fail.
If that happens, contact me (@fsundermeyer) and I will help.
====

=== For more information

...see the https://github.com/openSUSE/daps2docker[daps2docker repository].
You will also find instructions on how to install it on other distributions and how to set a custom configuration.

23 changes: 23 additions & 0 deletions asciidoc/common/attributes.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

// Always keep an empty line at the top

// asciidoctor attributes that should be used in every MAIN document


// leave TOC generation to the DocBook stylesheets
:toc:
// do not use a prefix for auto generated IDs
:idprefix:
// use "-" instead of "_" as a seperator for auto generated IDs
:idseparator: -

// show nice admonition icons in GitHub previews
ifdef::env-github[]
//Admonitions
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

12 changes: 12 additions & 0 deletions asciidoc/components/elemental.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
= Elemental

ifdef::env-github[]
:imagesdir: ../images/
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

https://elemental.docs.rancher.com
12 changes: 12 additions & 0 deletions asciidoc/components/fleet.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
= Fleet

ifdef::env-github[]
:imagesdir: ../images/
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

https://fleet.rancher.io
12 changes: 12 additions & 0 deletions asciidoc/components/longhorn.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
= Longhorn

ifdef::env-github[]
:imagesdir: ../images/
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

https://longhorn.io/docs/
12 changes: 12 additions & 0 deletions asciidoc/components/metal3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
= Metal³

ifdef::env-github[]
:imagesdir: ../images/
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

Coming soon
Loading
Loading