Create "browsable" source code based on ctags output? - ctags

Is there a way to take a program's source code, run ctags on it and generate an HTML file for each of original source code file, with hyperlinks at places where ctags can see relations in the code? How could I do that?

I believe http://lxr.sourceforge.net/en/index.php is what you're looking for.

Related

Where can I find an example of a file workflow.rst for generating snakemake reports?

I am trying to use the reporting function of snakemake which is documented here:
https://snakemake.readthedocs.io/en/stable/snakefiles/reporting.html
However I am finding it hard to find a meaningful example of what the workflow.rst file should look like.
I have looked at the output example
https://koesterlab.github.io/resources/report.html
but I can't find the code to generate this report.
It seems that the link in the documentation is broken.
I found an example in the tests of snakemake:
https://github.com/snakemake/snakemake/tree/master/tests/test_report
The snakefile generating a report is there:
https://github.com/snakemake/snakemake/blob/master/tests/test_report/Snakefile
It uses the following .rst file:
https://github.com/snakemake/snakemake/blob/master/tests/test_report/report/workflow.rst

Comments in _CoqProject

Is there a way to have comments in a _CoqProject file?
I'd like to compile only part of a library, without completely removing all the other files from the _CoqProject file.
# is treated as a comment-the-rest-of-the-line symbol.
I think it is not documented as of now (see issue #7647). But the source code and some experiments show that it works.

Get the source code of a ruby file in the form of a string/text

Is there any simple way to get all the source code of a ruby file in the form of a string? I'm looking for something that would behave like inspect.sourcelines(codeObj) in python.
I'm surprised this hasn't been asked before... But I couldn't find the question on SO anywhere...
myCode = File.read(__FILE__)
That should do the trick.
__FILE__ is a special variable which contains the full file path of the currently executing file. Depending how you script is being executed you might be better off using $0 instead. But this really depends on what you really want.

Doxygen filter format?

With my team we create software we need to document. I have found doxygen which seems a nice program to do this. Although our programming language is not supported (RAPID).
Yesterday I have asked a question about this. Albert was kind enough to provide a clue in the right direction. A filter should be the right way to go in stead of an preprocessor.
But I did not provide the syntax of the RAPID code which can be found here :
http://futurecnc.code.arc.cmu.edu/wp/wp-content/uploads/2011/12/RAPID-Reference-Manual-Instructions.pdf
I found the help guide about creating filters from the doxygen website. Also i have found an example filter created by Bert Jordan for perl :
http://www.doxygen.nl/helpers.html
Some questions :
Is a filter the right way to go, or is a preprocessor needed ?
What is the filter exactly doing ?
Doxygen has an lexical scanner, what kind of format must be used for the filter to convert the rapid code to a supported language?
I hope, I have given a clear description now :)
edit : I'm searching for information about how to create the actual filter.
Does anybody know a good source for this ?
There are some examples on filters for other languages at the doxygen site under the helpers section.
I have used an doxygen filter (which is not listed there) for Bash for one of my projects. The filter is pretty simple and might be a good example. This filter is available at Anvils github.
In essence it is just a ~130 line sed script converting bash to quasi-C which doxygen can parse. You could write your own sed script for RAPID.
You should add it to your Doxyfile with:
# Tell doxygen to handle files with sh extension as C files
EXTENSION_MAPPING = sh=C
# Tell doxygen to run sh files through the below sed script
FILTER_PATTERNS = *.sh=MY_PATH/doxygen-bash.sed
There is also a python example via the helpers page here.
The main part to understand is that the filter can be anything you like to write. Python, sed, shell, etc. Doxygen just calls your filter, runs the code through it and your filter should output a language Doxygen can parse.

Visual Studio 2013: How to add file name to the output of a snippet?

I need to include the name of the file that the snippet is being inserted to the output.
I looked into Code Snippet Functions (http://msdn.microsoft.com/en-us/library/ms242312%28v=vs.80%29.aspx) and the selections are limited.
Is there any way to insert the name of the file that the snippet is being inserted into to the snippet output?
You can add ${1:${TM_FILENAME_BASE}} tag in json snippet file to get file name and add it to output of snippet.
It does not seem possible to do with snippets, but it is possible with Item Templates. See this post for more information.
Maybe this could help: File Header code snippet or this one: Code Snippet Functions. In short using Declariations->Literals and Code snippet functions should resolve your problem.

Resources