How to render asciidoc filename in asciidoctor template? - asciidoctor

I have a asciidoctor template similar to this one:
https://github.com/asciidoctor/asciidoctor-backends/blob/asciidoctor-v0.1.4/erb/html5/document.html.erb
I would like to include a link into my documents which points to the asciidoc file that was used to generate the document.
Is there a way to access the asciidoc filename within my template?
I'm using the asciidoctor-maven-plugin to render my documents.

By looking at the built-in data attributes, I think that you are looking for {docfile} (evaluation depends from how the document is processed and when and where is it processed).
For me it works with the asciidoctor-maven-plugin (I get the absolute path to the file) but not in the chrome preview.

Related

AsciiDoc navigation panel

How i can create a left navigation panel in AsciiDoc?
like this one here https://docs.asciidoctor.org/asciidoc/latest/
not a list of contents.
Thanks.
The navigation pane in your screenshot includes links to many HTML files. asciidoctor doesn't have any built-in facility for generating multiple HTML files from an Asciidoc markup file.
To do that for your own Asciidoc content, you need a tool that processes many Asciidoc files and generates an entire site. Such tools are called static site generators. There are many, and quite a few support Asciidoc markup, including Hugo, Jekyll, and Eleventy.
The Asciidoctor documentation was generated with a tool called Antora, which was created by the author of asciidoctor. Its goal is to specifically support generating technical documentation web sites (and eventually PDF documents) from Asciidoc markup.
Many companies with large sets of technical documentation use Antora. This page lists the companies and sites using Antora, plus public repos with the implementations (where available).

Transform XML to PDF using XSLT with nodejs

I have xml file that contains remote xsl stylesheet link. I need to convert that xml to pdf? I have tried Prince but it is not adding desired style. Is there any other package that i can use for this purpose?
You can try with package (https://www.npmjs.com/package/xml-pdf) in this you can set your custom template also for design purpose. I have committed a GitHub repo for you. https://github.com/vivek9716/convert_pdf please check if this is helpful.

How can I use python to edit docx and/or doc file tags on a windows system?

I have a folder with a large amount of .doc and .docx files, I would like to develop a python script to edit the tags of each file so I can find a file in the folder using the tags - thus making my life a little easier.
I am unsure of how to even start and was hoping someone could point me to a library or provide some sample code to help me get started.
I am not sure if the file extenstion matters because this seems to be a windows property (right-click file > Properties > Details > Tags > type in tags) but if the extension matters I do can change all the files to be .docx
The python-docx package provides methods to access most of the metatdata in a word file. The class docx.opc.coreprops.CoreProperties in specific allows you to modify author, category, etc. I didn't see tags mentioned but if you do some more research i'm sure you can find it.
docx.opc.coreprops.CoreProperties.keywords can be used to update doc file tags.

Searching from File title as well as file content in media library

I managed to Search the contents of text files using custom search as described in the link below: https://docs.kentico.com/k8/custom-development/miscellaneous-custom-development-tasks/smart-search-api/creating-custom-smart-search-indexes
But it is not able to search in the filename. For example, if my search text is "Roman", the file "RomanRaj.txt" should show up in the results. Please help.
Try to add file name to your search index by index content customization. See the documentation on this topic.
I'd suggest NOT creating a custom smart search index but look at using attachments and searching those. Out of the box, Kentico will allow you to search attachments and their contents without writing any code.

Is there a way to include source positions in the rendered output of a Twirl template?

The *.scala files that are generated by Twirl include the information that binds the generated code to the lines in source templates. Is there an option to further include this information in the output of template's render function?
If there isn't such an option what could be the recommended way of implementing this feature? Right know I cannot find where the debugging information from generated *.scala template files is consumed...

Resources