How to include PlantUML in Asciidoc with Antora? - asciidoc

I would like to inlcude a PlantUML file inside an Asciidoc file and build an Antora site.
foo.adoc
[plantuml, bar, svg]
....
include::bar.puml[]
....
bar.puml
#startuml
<... valid PlantUML>
#enduml
The PlantUML does show up correctly inside my IDE (IntelliJ).
Problem
When i run antora antora-playbook.yml, i get the following error:
ERROR (asciidoctor): target of include not found: bar.puml
file: /$PROJECT_PATH/docs/modules/ROOT/pages/foo.adoc:11
source: /$PROJECT_PATH (branch: #branch-name <worktree> | start path: docs)
Skipping plantuml block. GET https://kroki.io/plantuml/svg/<image-id> - server returns an empty response or a 404 status code
Everything works fine if i use inline PlantUML instead of an include statement.
Update
I've already tried to use the following Antora Resource ID's:
include::page$bar.puml[]
include::ROOT:page$bar.puml[]
include::ProjectName:ROOT:page$bar.puml[]
include::{docdir}/bar.puml[]
The error message remains the same: target of include not found: ...
My project structure looks like this:
- modules
- antora.yml
- antora-playbook.yml
- ROOT
- pages
- foo.adoc
- bar.puml

The root cause is: ERROR (asciidoctor): target of include not found: bar.puml.
When working with Antora, you should reference a resource using an Antora resource ID: https://docs.antora.org/antora/latest/page/resource-id/
[plantuml, bar, svg]
....
include::example$bar.puml[]
....
https://docs.antora.org/antora/latest/page/include-an-example/

Related

Why is Eleventy looking for templates in my /history folder?

For some reason Eleventy is looking for templates in my /history folder, which I have already made changes to. Is there a way to stop this?
Now when I run my build the following error occurs:
[11ty] 2. (./.history/_includes/layouts/base_20220423223526.njk)
[11ty] Error: template not found: partials/navigation.njk (via Template render error)
[11ty]
[11ty] Original error stack trace: Template render error: (./.history/_includes/layouts/base_20220423223526.njk)
[11ty] Error: template not found: partials/navigation.njk
Here is my repo if you would like to have a look:
https://github.com/dulzorigo/eleventy-tailwind
Forked from:
https://github.com/ThirusOfficial/eleventy-tailwind
By default, Eleventy processes all files in your provided input folder, which is the root of your project in this case. To have Eleventy ignore certain folders or files, you can create an .eleventyignore file containing .history. See the Eleventy documentation for more information.

error generating documentation my component

I have created a backstage scaffolding template to create a Spring boot rest service deployed to AWS EKS.
When a component is created from it in backstage the component builds using github actions, is deployed to AWS EKS and is registered in backstage.
However clicking on docs for the component fails with the following error
1 info: Step 1 of 3: Preparing docs for entity component:default/stephendemo16 {"timestamp":"2022-04-28T22:36:54.963Z"}
2 info: Prepare step completed for entity component:default/stephendemo16, stored at /tmp/backstage-EjxBxi {"timestamp":"2022-04-28T22:36:56.663Z"}
3 info: Step 2 of 3: Generating docs for entity component:default/stephendemo16 {"timestamp":"2022-04-28T22:36:56.663Z"}
4 error: Failed to build the docs page:
Could not read MkDocs YAML config file mkdocs.yml or mkdocs.yaml for validation; caused by Error: ENOENT: no such file or directory,
open '/tmp/backstage-EjxBxi/mkdocs.yml' {"timestamp":"2022-04-28T22:36:56.664Z"}
ERROR 404: T: Page not found. This could be because there is no index.md file in the root of the docs directory of this repository.
Looks like someone dropped the mic!
Catalog-info registers the docs subdirectory
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: "stephendemo16"
description: "try using template"
annotations:
github.com/project-slug: xxxx/stephendemo16
backstage.io/techdocs-ref: dir:docs
The docs subdirectory contains index.md which contains
## stephendemo16
try using template
## Getting started
Start write your documentation by adding more markdown (.md) files to this folder (/docs) or replace the content in this file.
## Table of Contents
The Table of Contents on the right is generated automatically based on the hierarchy
of headings. Only use one H1 (`#` in Markdown) per file.
...
What have I missed?
Having an index.md alone is not sufficient.
Internally, TechDocs is currently using MkDocs. Mkdocs has a config file called mkdocs.yaml that defines some metadata, plugins, and your file structure (table of contents).
Place an mkdocs.yaml inside your root directory. Mkdocs expects that all markdown files are located inside a /docs sub directory. It references your index.md file relative to that folder:
# You can pass the custom site name here
site_name: 'example-docs'
nav:
# relative reference to your Markdown file and an optional title
- Home: index.md
plugins:
- techdocs-core
The location of your mkdocs.yaml is the root folder of your documentation. Therefore you have to adjust your backstage.io/techdocs-ref annotation to dir:. (means the same folder as your catalog info file).
You can find more details about using the TechDocs setup in the Backstage docs.

Rails 5.1 Moving js files from app/assets/javascripts to app/javascript

I was trying to move my JS files from app/assets/javascripts to app/javascript. Basically moving away from Asset Pipeline to Webpack.
I am getting multiple errors on the process.
1. The only thing I did is moved the file and removed the precompile statement from config/initializers/assets.rb
This is what I get:
DEPRECATION WARNING: The asset "disallow-char.js" is not present in the asset pipeline.Falling back to an asset that may be in the public folder.
This behavior is deprecated and will be removed.
To bypass the asset pipeline and preserve this behavior,
use the `skip_pipeline: true` option.
2. Then I added the following on the html.haml file:
```= javascript_include_tag 'disallow-char.js', skip_pipeline: true```
This is what I get:
Started GET "/javascripts/disallow-char.js" for ::1 at 2018-04-26 15:11:18 -0500
Processing by ErrorsController#routing as JS
Parameters: {"any_bad_route"=>"javascripts/disallow-char"}
::1 - - [26/Apr/2018:15:11:18 CDT] "GET /packs/application-26fc747cc9104717d89e.js HTTP/1.1" 304 0
And on the Browser I am getting this error:
GET http://localhost:3000/javascripts/disallow-char.js net::ERR_ABORTED
The location of the file is app/javascripts/frontend/disallow-char.js
My app/javascript/packs/application.js looks as follows:
/* eslint no-console:0 */
// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
//
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.erb
const frontend = require.context('../frontend', true, /\.js$/);
application.load(definitionsFromContext(frontend));
export default application;
Has anyone seen there error before? Anything that I am missing?

Error with SCSS generation in Jekyll 2.0

I have my project laid out like so:
-Project
-css
-import.scss
-_sass/
main.scss
The contents of import.scss are:
---
---
#import "main.scss";
What I expected to happen was for main.scss to be imported into import.scss, then, import.scss would compile to import.css within the genrated _site/ directory.
Instead, I get the following error
Conversion error: There was an error converting 'css/import.scss'.
jekyll 2.0.3 | Error: Invalid CSS after "-": expected number or function, was "--"
I'm guessing it's complaining about the YAML front-matter at the top of import.scss, but I'm unsure what the solution is.
I had the same error, but here was my fix: use the “---” YAML front-matter only on the /css/*.scss files (e.g. your import.scss), but not on the partials.
The error seems to be referring to front-matters in the partials (/_scss) files. Once I took though out, the Sass started compiling again.
Hope this helps!

How to create a link to external file section with Sphinx?

I want to create a link that refers to a section defined in another file.
I have found a similar question on "Python-Sphinx: Link to Section in external File" and I noticed there is an extension called "intersphinx".
So I tried this extension, but it doesn't work (Probably my usage is wrong).
I have tried the following.
conf.py
extensions = ['sphinx.ext.todo', 'sphinx.ext.intersphinx']
...
intersphinx_mapping = {'myproject': ('../build/html', None)}
foo.rst
...
****************
Install Bar
****************
Please refer :ref:`Bar Installation Instruction<myproject:bar_installation>`
I want to create a link like 'Bar Installation Instruction' with above markup.
bar.rst
...
**************************
Installation Instruction
**************************
.. _bar_installation:
some text...
When I run make html, I get the following warning and the link is not created.
foo.rst: WARNING: undefined label: myproject:bar_installation (if the link has no caption the label must precede a section header)
Thanks in advance.
Looks like it's not able to find your mapping inventory file. The first part of the tuple serves as the base URL for your links while the second part is the path to the inventory file. I believe the auto downloading of the inventory files (when you pass None) only works with URIs and not file paths.
In this example, I can build the documentation locally, but it will link to http://example.com/docs/bar.html
'myproject': (
'http://example.com/docs/',
'../html/objects.inv'
)

Resources