I have been experimenting with generating DocBook output using Maven running within Eclipse. I found the Maven plugin called docbkx, and it almost gets me there.
In the DocBook world, the way that you change some of the default behavior of the XSL transformations is by defining your own XSL file as a "customization layer." This file imports the standard XSL file and then any templates, etc. that you want to change are put in this file. Thereby, they are parsed after the standard templates, and your altered version is what is used.
To make this happen using the docbkx plugin, you have to tell it that you are using a custom XSL file in the configuration, with lines like
<foCustomization>src/docbkx/xsl/custom_print.xsl</foCustomization>
Then, in the custom XSL file, instead of needing to specify the location of the standard XSL file in the import statement at the top, you put in a symbolic path that the plug-in resolves:
<xsl:import href="urn:docbkx:stylesheet"/>
This all works very well. But I have been banging my head against the wall trying to understand how the plugin can be told to look for other things you might want to import. Two examples:
my customization layers import not just the regular stylesheet, but
also a custom titlepages XSL file I generated by the usual process.
I have a template to write a chunk of additional code into the HTML
output's head element. Specifically, it's the code to hook up to
Google Analytics. The code is in an external file.
In both cases the files being imported are sitting in the same directory as the customization layer, but best as I can tell the plugin can't find them. I don't know how to get the plugin to include these as it does its work.
Any ideas?
Thanks!
Alan
If you have something like:
src
|
+--docbkx
|
+--xsl
|
+--custom_print.xsl
+--custom_titlepages.xsl
and a pom like:
...
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
...
<foCustomization>src/docbkx/xsl/custom_print.xsl</foCustomization>
...
include in your custom_print.xsl the custom_titlepages.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="1.0">
<xsl:import href="urn:docbkx:stylesheet"/>
<xsl:include href="custom_titlepages.xsl"/>
You might find enlightening these documents:
Advanced Customization
Customizing both HTML and FO
Related
I like to add additional macros to asciidoctor for these types:
path:[some path value]
label:[some label text]
replace:[some value to become replaced by the user]
screen:[something the users sees on screen]
I mainly want to have it rendering some CSS classes while rendering to HTML5. I found several sources on how to write a macro for asciidoctor, but I do not get the point. Where to place or insert the ruby code and classes I write? Here is an example page I found: https://docs.asciidoctor.org/asciidoctor/latest/extensions/inline-macro-processor/
But I found no simple step-by-step information about where to place that?
Can someone tell me:
In which file(s) shall I add my macro code?
How to enable this in general for asciidoctor (so I can simply call it without the need to put it into the comandline call. Or do I have to register the macro in the call all the time?
I installed asciidoctor on Ubuntu 20.04 using apt-get install asciidoctor. Seems it works so far. But I found no files for the predefined macros btn, kbd and menu.
I'm a little lost here... Any help is appreciated.
PS. I know the syntax [.label]#some label text# to place CSS classes, but I want to have it generic and also usable for PDF generation later.
After many different tries and research I finally found it to be easy. Just point asciidoctor to the file you want to include by using the -r comandline parameter:
asciidoctor -r ~/tools/asciidoctor_patch/include_asciidoc.rb
Sadly, the whole asciidoctor documentation names this parameter only "require" and does not even mention this to be used for extensions. I also found no source that mentions the use of -r for including the macros.
I am using the WebEssentials 2013 plugin to minify my js files and I am assuming whenever I build the application in release mode it has to take the minified file rather than the original file. This is not happening with my MVC 4 application. Does anyone have any clue on this issue?
Note: I have already done the below change in BundleConfig.cs:
#if !DEBUG
BundleTable.EnableOptimizations = true;
#endif
Scripts
Projects
Project.js.bundle
Project.min.js
Project.min.js.map
Project.js.bundle file
<bundle>
<settings>
<minify>true</minify>
<runOnBuild>true</runOnBuild>
<outputDirectory />
</settings>
<files>
<file>/Scripts/Project/CreateProject.js</file>
<file>/Scripts/Project/ViewProject.js</file>
<file>/Scripts/Project/EditProject.js</file>
<file>/Scripts/Project/CloseProject.js</file>
</files>
</bundle>
I have four views like Create Project, View Project, Edit Project, Close Project.
Can I use the bundle for every view or just use a minified file in each view? Which is the best option? I don't know how to include a bundle in my view. Can you provide me with the syntax?
I think you're confusing two different tools here.
WebEssentials 2013 can auto-minify on build, but you'd need to actually reference the minified file to use it.
Example:
<script src="/js/yourjs.min.js"></script>
Your BundleTable.EnableOptimizations line is using System.Web.Optimization bundles. If you use script or style references to your bundles rather than to the JS or CSS files directly, you will notice the behavior works as you anticipate.
Example:
#Scripts.Render("/bundles/yourbundle")
See Bundling and Minification for more information
When you use WebEssentials 2013 plugin with is generating *.min.js you need to reference min file directly like
script src="myscripts.min.js"
or you can reference them with condition if
like
#if (DEBUG)
script src="myscripts.js"
#elif (RELEASE)
script src="myscripts.min.js"
#endif
Im about to documentate a library I have that uses NSManageObjects using Doxygen. Since NSManageObjects are autogenerated from the data model, if I change something in the model, the file containing the modified managedobject is going to be generated again.
I donĀ“t want to rewrite documentation everytime a change is made in the model.
Do you know any way to accomplish this?
Thanks.
I found out how to achieve it. Doxygen allow you to document classes from other files. There is no need to do it in the .h.
Doxygen parses the .h file and he creates the documentation skeleton for that class. Then you can add documentation from any other custom file.
The problem is that you have to manually specify some labels in order to link the information from the .doc file with the class declared in the .h file.
Please see:
Doxygen documentation at other places
and this: Properties not being documented
Should be enough to get an idea of how I did managed to do it.
As far as i could dig in thought google, i found something like:
<languages>
<language tag="en-GB">en-GB.whatever.ini</language>
<language tag="en-GB">en-GB.whatever.sys.ini</language>
</languages>
From here some question:
Can i use it without tag and somehow specify to use with the default system language
What is the difference between whatever.ini and whatever.sys.ini
Do I have something else to write to xml or those 4 lines uploads and runs languages
The tag="en-GB" is required.
.ini contains ALL the translations including the description for an extension when it it opened up in the Module or plugin Manager....sys.ini is used to define the description of the extension upon installation.
The code you provided in the XML is fine ;)
I have gotten this Ant script to work for XSLT 1.0 using the standard transform engine. However, I want to use XSLT 2.0 as well and I am running into a brick wall.
I have included the Saxon Jar and defined the factory class. When I run the script, I get a long pause (Maybe 10 seconds, way too much for my XSLT which is about 10 lines long) then I get a BUILD FAILED: Fatal error during transformation
Any help would be much appreciated:
<project name="TranformXml" default="TransformFile">
<target name="TransformFile">
<!-- Transform one file into an HTML file -->
<xslt in="input.xml"
out="student.html"
style="transform.xsl"
processor="trax" force="true" classpath="./lib/saxon/saxon9he.jar">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
</target>
</project>
I have tried a number of variations of this, including putting the directly in the <xslt> element, plus toggling the processor and force options. Same problem every time.
(Note, I have tested my XSLT and XML in Oxygen and it works well there)
Thanks,
Casey
Sorry guys. I should have been more verbose. I did find out why it was happening though. It was because I was not using resolve-uri() correctly.