Exclude "README.md" from doxygen's "File documentation" list - c++

I am struggling with the following problem. I use doxygen to document my C++ code, and use the README.md to document the main page of my code documentation, via
INPUT += README.md
USE_MDFILE_AS_MAINPAGE = README.md
in my doyxgen configuration file. Everything works, except that the file README.md appears in the "File documentation" section of my generated .pdf out of the refman.tex file (it doesn't appear in the "File list" section), like
8.24 /Users/username/qpp/README.md File Reference . . . . . . 123
This is extremely annoying, as I don't want this file to appear in any file list. Is there any way to remove it? I cannot just add it to the EXCLUDE = list, as if I do, it won't be used anymore to generate the main page.

As of today, I still haven't found an elegant solution. What you can do in case you don't want README.md to appear in the File Reference section inside your .pdf is to manually comment the line
%\input{_r_e_a_d_m_e_8md}
in the generated refman.tex file, and only after that compile the .tex file to produce the final .pdf
latexmk -pdf refman.tex
The issue does not appear in the html generated documentation, only in the latex one.

Related

Viewing Doxygen results

I have tried running doxygen from my Linux terminal using the commands:
doxygen -g, followed by
doxygen Doxyfile
I then get the corresponding html sub-directory produced in the directory that my original code is stored in. However, when I open the index.html file in Google Chrome, I do not get any results being displayed - I just get a blank page saying My Project Documentation as shown below. Why is this the case?
Have you actually edited the Doxyfile that gets produced? There are a few lines in there that you want to look at:
PROJECT_NAME = "My Project Name"
INPUT += src
Also, when I ran it, I don't specify the Doxyfile, but that's just because Doxyfile is used by default.

bookdown preview with Rmd files in a subdirectory

I am wondering if it is possible to use preview_chapter() function with an .Rmd file that is in subdirectory? I've tried it, but got a document without actual text: only section headings and "Placeholder" string where text should have appeared. Once I moved the .Rmd file to the parent (project) directory, it generated the preview correctly. But having all .Rmd files in the project directory makes it look super messy and difficult to navigate through.

Why isn't vim-snipmate UltiSnips for Django not working?

I'm running Vim 8.0.124 and I've installed the vim-snipmate plugin to use in my Python and Django development. I followed the instructions by creating a .vimrc file that contains the following:
# ~/.vimrc
set nocompatible " Required by Vundle
filetype off " Required by Vundle
" Begin Vundle settings ==========================================================
"
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
# Optional
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
call vundle#end()
filetype plugin indent on
"
" End Vundle settings ==========================================================
" SnipMate
autocmd FileType python set ft=python.django
autocmd FileType html set ft=htmldjango.html
" UltiSnips
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsEditSplit="vertical"
Installing vim-snipmate includes the creation of these four files:
~/.vim/bundle/vim-snippets/snippets/django.snippets
~/.vim/bundle/vim-snippets/snippets/htmldjango.snippets
~/.vim/bundle/vim-snippets/UltiSnips/django.snippets
~/.vim/bundle/vim-snippets/UltiSnips/htmldjango.snippets
I have two questions. First, why are the UltiSnip Django snippets not working? The snippets in snippets/django.snippets work but those in the UltiSnips django.snippets file don't. If I open a file test.py and type "fdate" where fdate should expand into a Django DateField, nothing happens (other than a tab is entered). Initially, when the UltiSnips weren't working, I went to its Github page and read the instructions which seemed to indicate I should add the SirVer plugin so I did. Even then, then don't seem to work. I should add that what you see above is my entire .vimrc file. Also, I created a completely new ~/.vim directory which only contains the Vundle and vim-snipmate bundles so there shouldn't be any other conflicts.
My second less important question is, when I view any of these snippet files, most of the lines are folded. Is there any way I can configure Vim so that when I open any of these .snippet files, all the folds will be open? They would be easier to search that way.
Did you try with ":setfiletype htmldjango" ? or ":selfiletype django" (https://www.vim.org/scripts/script.php?script_id=1487)
Take a look in the docs, especially under section 4.1.1 How snippets are loaded UltiSnips-how-snippets-are-loaded
I had similar issue, I've created separate directory for snippets, at $HOME/UltiSnips. There I've created directory python, where I've moved files python.snippet and django.snippet. Similarly, you may create directories for another languages and use snippets for another frameworks.
From the docs:
UltiSnips iterates
over the snippet definition directories looking for files with names of the
following patterns: ft.snippets, ft_.snippets, or ft/, where "ft" is the
'filetype' of the current document and "*" is a shell-like wildcard matching
any string including the empty string.

How to use the exclude_files regex in cpplint?

I am using cpplint to check my sourcode agains the google style guide.
Cpplint's help says:
cpplint.py supports per-directory configurations specified in CPPLINT.cfg
files. CPPLINT.cfg file can contain a number of key=value pairs.
Currently the following options are supported:
"exclude_files" allows to specify a regular expression to be matched against
a file name. If the expression matches, the file is skipped and not run
through liner.
Example file:
filter=-build/include_order,+build/include_alpha
exclude_files=.*\.cc
The above example disables build/include_order warning and enables
build/include_alpha as well as excludes all .cc from being
processed by linter, in the current directory (where the .cfg
file is located) and all sub-directories.
How I use cpplint:
I use cpplint by this command to check all files in my source folder:
cpplint src/*.c
Well there is one special file foo.cc which must not be checked. So I tried to create a CPPLIN.cfg to use the exclude_files property. My file looks like this:
set noparent
filter=-build/include_dir
exclude_files=foo.cc
Nevertheless foo.cc is still checked.
What I have already tried to do:
I tried exclude_files=/.*\.cc/. This should exclude all files ending with *.cc. Nevertheless all files are still checked.
I tried to remove my filter from the file. This caused more errors than before. So I am now sure that my CPPLINT.cfg file is found by cpplint.
Question:
How to use the exclude_files regex in cpplint correctly?
Turns out apparently that the doc is wrong: exclude_files only excludes files in the same directory as CPPLINT.cfg, not in subdirectories. See https://github.com/google/styleguide/issues/220
So the solution would be to create src/CPPLINT.cfg and put exclude_files=.*\.cc in it.

Generating documentation with doxygen

I would like to generate documentation for C++ files with doxygen. Everything is good when all the *.h and *.cpp files are stored in one folder. Then I type
doxygen -g doxygenfile
and then
doxygen doxygenfile
After all this I have a latex folder and an html folder. Everything is good. The problem is when these files *.h *.cpp are stored in different locations, e.g.: *.h in H folder *.cpp in CPP folder and so on. Could somebody tell me how to generate the documentation in this case?
If you want a GUI to tweak how Doxygen works you can use doxywizard and open the generate Doxyfile.
In order to make doxygen look into the subdirectories you can change in the Doxyfile this line
RECURSIVE =
with
RECURSIVE = YES
Edit: As bornruffians pointed out, Doxygen looks for the source files in the directories specified in the INPUT setting (always in the Doxyfile). So you can specify each directory in the INPUT tag by writing something like
INPUT = "src/CPP" "src/H"
and turn off the RECURSIVE tag. You can also put single files as values for the INPUT tag.