Git Product home page Git Product logo

texdoclet's Introduction

WARNING: TeXDoclet is only working with Java versions up to Java 11 because of the removal of the old doclet API (com.sun.javadoc). A migration to the new Java Doclet API is currently not planned.

TeXDoclet

TeXDoclet is a Java doclet implementation that generates a LaTeX file from you Java code documentation.

Build

mvn clean install

Run

From command line

You have to specify that javadoc has to use another doclet than the default doclet by giving the following options to the javadoc call :

javadoc -docletpath <path to>TeXDoclet.jar \
	-doclet org.stfm.texdoclet.TeXDoclet \
	<TeXDoclet parameters>

Example :

javadoc -docletpath target/TeXDoclet.jar \
	-doclet org.stfm.texdoclet.TeXDoclet \
	-noindex \
	-tree \
	-hyperref \
	-texinit texdoclet_include/preamble.tex \
	-imagespath ".." \
	-output texdoclet_output/TeXDoclet.tex \
	-title "TeXDoclet Java Documentation" \
	-author "Greg Wonderly \and S\"oren Caspersen \and Stefan Marx" \
	-sourcepath src/main/java \
	-subpackages org.stfm.texdoclet

The most important is that you specify the Java packages (option -subpackage) and their location in the file system (option -sourcepath) correctly, otherwise no output will be generated (specifying -sourcepath alone is not sufficient).

See createDocs.sh scripts in /examples subdirectory for more examples.

Print help (TeXDoclet + javadoc help) :

javadoc -docletpath target/TeXDoclet.jar -doclet org.stfm.texdoclet.TeXDoclet

or (TeXDoclet help only) :

java -jar target/TeXDoclet.jar -h

Maven integration

Alternatively you can use TeXDoclet as an alternate doclet if you want to make use of the maven-javadoc-plugin.

First you have to check out the TeXDoclet code and make a maven build (by mvn clean install). This installs the TeXDoclet artifact in your local repository. Then you can use TeXDoclet as an alternate doclet in the pom.xml file of any project like this :

<project>
...
<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-javadoc-plugin</artifactId>
			<version>2.9</version>
			<configuration>
				<doclet>org.stfm.texdoclet.TeXDoclet</doclet>
				<docletArtifact>
					<groupId>org.stfm</groupId>
					<artifactId>texdoclet</artifactId>
					<version>0.9-SNAPSHOT</version>
				</docletArtifact>
				<sourcepath>src/main/java:src/test/java</sourcepath>
				<useStandardDocletOptions>false</useStandardDocletOptions><!-- important ! -->
				<destDir>apidocs_tex</destDir>
				<additionalOptions>
					<additionalOption>-tree<additionalOption>
					<additionalOption>-hyperref<additionalOption>
					<additionalOption>-output TeXDoclet.tex<additionalOption>
					<additionalOption>-createpdf<additionalOption>
					<additionalOption>-title "TeXDoclet Java Documentation"<additionalOption>
					<additionalOption>-subtitle "Created with Javadoc TeXDoclet Doclet"<additionalOption>
					<additionalOption>-author "Greg Wonderly \and S{\"o}ren Caspersen \and Stefan Marx"<additionalOption>
					<additionalOption>-subpackages org<additionalOption>
					<additionalOption>-shortinherited<additionalOption>
				</additionalOptions>
			</configuration>
		</plugin>
		...
	</plugins>
</build>
...

Calling mvn javadoc:javadoc creates TeXDoclet.tex (and TeXDoclet.pdf, see switch -createpdf) in the target/site/apidocs/apidocs_tex directory.

See pom.xml for example usage and more details about how to integrate TeXDoclet with maven site:site goal. Also check out this example maven site project documentation.

Known issues

If the pdflatex document compilation fails with a "TeX capacity exceeded, sorry ..." error message you better use the alternative command lualatex from the LuaTeX project.

Previous versions

License

TeXDoclet is free software and available under the terms of BSD-2-Clause License. For more information see LICENSE.txt.

texdoclet's People

Contributors

cepr avatar doclet avatar fmsywsnieu avatar nicoweidmann avatar ymarco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

texdoclet's Issues

TeXdoclet can't find JDK Doclet class

I tried the suggested command, but I get:

✦ at 18:16:24 ❯ javadoc -docletpath TeXDoclet.jar  -doclet org.stfm.texdoclet.TeXDoclet     -noindex     -tree     -hyperref     -output out.tex     -title "Ranked Search Engine API"     -author "Paolo Boldi and Sebastiano Vigna"     -sourcepath src/main/java     -subpackages eu.fasten.core.search
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/javadoc/Doclet
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at jdk.javadoc/jdk.javadoc.internal.tool.Start.loadDocletClass(Start.java:781)
	at jdk.javadoc/jdk.javadoc.internal.tool.Start.preprocess(Start.java:752)
	at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:371)
	at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:342)
	at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
	at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
Caused by: java.lang.ClassNotFoundException: com.sun.javadoc.Doclet
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	... 16 more

No main manifest attribute

Hi

Just trying to use the *.jar file you provided on the project page.

When I try to execute the JAR file, I am getting this message:
image

I am using

  • Windows 10 Pro Build 14393.rs1_release_inmarket.161208-2252;
  • Java version:
    • java version "1.8.0_111"
    • Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
    • Java HotSpot(TM) 64-bit Server VM (build 25.111-b14, mixed mode)
  • My terminal emulator is: mintty 2.6.2 (x86_64-pc-msys) (C) 2013/2016 Andy Koppe / Thomas Wolff
  • My shell is GNU bash, version 4.3.46(2)-release (x86_64-pc-msys)

I am probably missing something obvious here, and I know I can build it if I want to, but that requires me downloading other stuff on top of this. Just wondering if you can help me get the JAR file to run.

Many thanks

Ashley.

A problem with square bracket

I use your doclet since 1 week to provide manual to my student ...
I have a problem with array variable. For example a part of my code is :
public Pion[] pions;

But after generate my javadoc, i have the followed code :
\index{pions}
\label{ProjetCase.pions}public Pion {\bf pions}\begin{itemize}

and the square bracket disappear ... Have I forget some think ???

Very thanks for your apps ..
Thomas Castanet
Teacher of mathématics
French lycée in Mali

Add support for @value

There is currently no support for the javadoc tag @value, usage: {@value #CONSTANT}.

Current output: #CONSTANT
Desired output: Value of constant.

Project doesn't build with maven out of the box

According to the readme, you should be able to build by cloning and running mvn clean install. This doesn't work for (at least) the following reasons:

  • Maven can't find the txtmark dependency (it is not in Maven Central)
  • src/main/java/org/stfm/texdoclet/HTMLtoLaTeXBackEnd.java has file encoding issues
  • Maven complains about missing symbols in TeXDoclet.java, presumably the com.sun.javadoc.* classes

imagepath is broken

The plugin is just generating texdoclet_images-folder but also does not find images located anywhere. It does not find it in the source folder, not relativly or absolutly or in the autogenerated folder.

TexDoclet failes with string parsing error

I encountered the following error when I ran TexDoclet on my code. The code in question was about 91 packages from Eclipse ICE. I generated an Ant build file from the Eclipse Javadoc tool and then ran it from the command line. Here is the error:

[javadoc] javadoc: error - In doclet class org.stfm.texdoclet.TeXDoclet, method start has thrown an exception java.lang.reflect.InvocationTargetException
[javadoc] java.lang.StringIndexOutOfBoundsException: String index out of range: -1
[javadoc] at java.lang.String.substring(String.java:1931)
[javadoc] at org.stfm.texdoclet.TeXDoclet.classRelativeIdentifier(TeXDoclet.java:2134)
[javadoc] at org.stfm.texdoclet.TeXDoclet.printTags(TeXDoclet.java:2034)
[javadoc] at org.stfm.texdoclet.TeXDoclet.printMember(TeXDoclet.java:1750)
[javadoc] at org.stfm.texdoclet.TeXDoclet.printMember(TeXDoclet.java:1598)
[javadoc] at org.stfm.texdoclet.TeXDoclet.printMembers(TeXDoclet.java:1588)
[javadoc] at org.stfm.texdoclet.TeXDoclet.layoutClasses(TeXDoclet.java:1317)
[javadoc] at org.stfm.texdoclet.TeXDoclet.start(TeXDoclet.java:736)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:497)
[javadoc] at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:310)
[javadoc] at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:189)
[javadoc] at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:366)
[javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:219)
[javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:205)
[javadoc] at com.sun.tools.javadoc.Main.execute(Main.java:64)
[javadoc] at com.sun.tools.javadoc.Main.main(Main.java:54)

Any help would be much appreciated! Thanks for the great tool!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.