From 5a28707fa52db1a8f3075543ef3af651ccfb62e4 Mon Sep 17 00:00:00 2001 From: Jiahao Chen Date: Tue, 21 Oct 2014 12:09:28 -0400 Subject: [PATCH] Add simple Doxygen filter for Julia Also modifies Doxyfile to accept Julia source files, telling doxygen to parse Julia files with its C parser. Now of course Julia is NOT C at all, but doxygen allows you to fool it by running input filters on source files. The Julia-to-pseudo-C filter is the most brain-dead thing you can imagine. All the heavy lifting is done by JuliaParser.jl; the filter simply looks for function declarations, rewrites the signatures into pseudo-C notation, and then spits out the body of the function parsed by JuliaParser wrapped with a pair of braces. The pseudo-C function signature is quite incomplete: - varargs drop the names of the variable (e.g. myarrays... -> ....), - kwargs are ignored Nonetheless it's quite amazing how much functionality you can get from such a terrible hack! --- contrib/Doxyfile | 8 ++++---- contrib/doxyfilter.jl | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) create mode 120000 contrib/doxyfilter.jl diff --git a/contrib/Doxyfile b/contrib/Doxyfile index 7d95037c15cee..130ddf42085d0 100644 --- a/contrib/Doxyfile +++ b/contrib/Doxyfile @@ -280,7 +280,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = jl=C # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -772,7 +772,7 @@ INPUT_ENCODING = UTF-8 # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, # *.qsf, *.as and *.js. -FILE_PATTERNS = *.c *.cpp *.h +FILE_PATTERNS = *.c *.cpp *.h *.jl # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. @@ -866,14 +866,14 @@ INPUT_FILTER = # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. -FILTER_PATTERNS = +FILTER_PATTERNS = *.jl=/Users/jiahao/sandbox/jldoxy/doxyfilter.jl # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER ) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. -FILTER_SOURCE_FILES = NO +FILTER_SOURCE_FILES = YES # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and diff --git a/contrib/doxyfilter.jl b/contrib/doxyfilter.jl new file mode 120000 index 0000000000000..479683966fb9b --- /dev/null +++ b/contrib/doxyfilter.jl @@ -0,0 +1 @@ +/Users/jiahao/sandbox/jldoxy/doxyfilter.jl \ No newline at end of file