How to make doxygen copy a folder without changes into generated HTML docs? - html

I have a folder with bla.html file and some assets (*.png and *.json) it it.
I want doxygen to copy it into HTML documentation root.
How to make it do such thing in doxygen configuration file (not using external script)?

Upon request:
How about (from the documentation / Doxyfile):
HTML_EXTRA_FILES The HTML_EXTRA_FILES tag can be used to specify one
or more extra images or other source files which should be copied to
the HTML output directory. Note that these files will be copied to the
base HTML output directory. Use the $relpath^ marker in the
HTML_HEADER and/or HTML_FOOTER files to load these files. In the
HTML_STYLESHEET file, use the file name only. Also note that the files
will be copied as-is; there are no commands or markers available. This
tag requires that the tag GENERATE_HTML is set to YES.
The full doxygen documentation can be found at : http://doxygen.nl/manual/index.html and the referred part at: http://doxygen.nl/manual/config.html#cfg_html_extra_files

Related

Can't change Apache2 shared folder's file

I'd like to change the page that shows what files I've uploaded. I never found the editable file. Can it be changed at all?? I have read a bunch article about this problem but I haven't found the solution.
I am talking about this page: Index of /--
Here is my shared folder: Location
Change the index file (probably: index.html or index.php) or add one yourself, if it does not exist yet. You can use .htaccess for example, if the directory or files inside should be access protected. You can also redirect the user when he is accessing the directory or a file inside.
The images that you have provided show the fallback display of a directory for apache.

Gitignore generated pdf but not all pdf

In my project we have certain markdownfiles which are used to generate pdf and html with the same filename (just different extensions). I would like to gitignore those pdf files not other pdf files (which are not generated).
I know that I could manually unignore those files one by one, also I know I could designate a folder to be unignored. But I was looking for some kind of a pattern by which I could ignore the generated files, that would by itself ensure that the non-generated files are not ignored.
Generate it to specific folder/subfolder and ignore this folder by gitignore specification.
It is most simple and efective solution.
If you are opened to naming these generated pdf files with a slightly different extension such as .gen.pdf instead of .pdf, this would give you the opportunity to differentiate these files with a pattern:
*.gen.pdf
which will ignore your .gen.pdf files and not the .pdf files while keeping all your files in the same directory.
gitignore rules can't handle such a complex rule for which a file would be ignored only if another file with the same name but not the same extension exists.
If renaming your files is not an option, then you could also add an extra step in the script used to generate these .pdf files, which would simply append the name of the generated .pdf to the .gitignore.
If you have a naming convention for your files that can be used to ignore them. If the filenames does not follow a pattern, you could do it as step pointed in his answer, save the pdf files to a specific folder and just ignore that folder in your .gitignore file.

change folder index to a HTML page within folder

I have seen a few examples with link to folder but i realy don't understant what it is or how to manipulate it or get it to set the specific html page within the folder.
My website is a basic one with only CSS and HTML
it is formatted as
[file]home.html // C:/Users/user/Desktop/mywebsite/home.html
[folder]Order // C:/Users/user/Desktop/mywebsite/order/
↳[file]ordersheet.html // C:/Users/user/Desktop/mywebsite/order/ordersheet.html
I want to try set the folder path C:/Users/user/Desktop/mywebsite/order/ as the file ordersheet.html C:/Users/user/Desktop/mywebsite/order/ordersheet.html how can this be done?
To set /order to ordersheet.html change the name of ordersheet.html to index.html
The index.html is the default file that the server will serve to the visitor when he visits that specific directory.
link text
link text = what you want it to say to the user
/Users/user/Desktop/mywebsite/order/ = directory path
Keep in mind that this will only work locally. If you have it up on a server, visitors don't have access to your full C:/ drive so you have to use relative links, i.e. just /order/
If I remebember correctly, you use something like this:
<a href="file:///C:/Users/user/Desktop/mywebsite/order/ordersheet.html>link to file on harddisk</a>
If you would want to have that anchor to a folder, you would just use this:
<a href="file:///C:/Users/user/Desktop/mywebsite/order/>link to a folder on harddisk</a>
Your browser is operating directly on your system's local filesystem, so you can't.
What you have been looking at is a function of a web server (I'll use Apache HTTPD for examples here).
A typical configuration of a web server would map the local part of the URI onto a directory on the local file system and just serve up the files there if they matched the local part of the URI.
If the local part resolves to a directory (rather than a file) then it would look for a file in that directory with a name that matched a list (typically including index.html) and serve up that file.
If none of the files on the list existed, then it would generate an HTML document containing links to all the files in the directory.
Since there is no web server involved when the browser is reading the local file system directly, there is no way to map the directory onto an index file, so you would need to explicitly include the filename in the URI (or switch to using a web server).

customizing `org-publish-project-alist`

I'm trying to publish webpage using org-mode. Two questions:
Is there a way to "sync" the org-mode files in the base-directory and the html files in the publishing-directory? Specifically, if I delete an org file in the base-directory, can I get org-publish-html to delete the corresponding file in the html directory also?
If I have pages within subdirectories, how can I specify a single .css file in the root directory to be used for the style sheet? For instance, my directory structure is as follows:
public_html/
css/
mystyle.css
index.html
subdir/
index.html
With the following specifications in org-publish-project-alist (this is just a subset) --
:publishing-directory "public_html"
:style "<link rel=\"stylesheet\" href=\"css/mystyle.css\" type=\"text/css\"/>"
mystyle.css is used by public_html/index.html but not by public_html/subdir/index.html. Is there a simple remedy to this (I want the style sheet to be used by both/all files in subdirectories)?
Thanks much ~
There is no straightforward way of doing this. Org-mode doesn't know (or care) about the location to which it is publishing - it just sends things there and makes sure the correct directory structure exists. There is a hook in the publishing process that gets called after the files have been pushed to their published location. This is controlled by setting the :completion-function property in your org-publish-project-alist. You could use this hook to write a function that compares the *.org files in your base-dir and subdirectories to the accompanying *.html published files, and remove those *.html files that don't have an accompanying *.org file.
I suspect this will be most easily accomplished by making your Lisp completion-function call a shell script that removes the necessary files. If you are doing something fancy with the :include, :exclude, or :base-extension properties, you'll likely want your completion-function to grab the pertinent information from the plist and then pass them to your shell script. This org-mode page has an example completion-function that shows how to get property values for the org-publish-project-alist. You would then need to pass them to your shell script.
There are several ways to do this. Perhaps the simplest is to just override the default style sheet in each file with a line such as:
#+STYLE: <link rel="stylesheet" type="text/css" href="../stylesheet.css" />
for your first level of subdirectory files, and keep adding ../ as you get deeper in the directory structure.
Another possibility is generate generic template files for each level within the directory tree. This org-mode page gives a nice example of how to set this up.
Lastly, another option is to use the :preparation-function property of org-publish-project-alist to define a function that will automatically change the style file for each file. Again, this is probably best done by having the Lisp preparation-function call a shell script to parse the files. I could imagine doing this with the Unix sed program to find a regular expression denoted something like href="#MYLOC#/stylesheet.css" /> and substitute the stuff between #'s with the appropriate level within the directory tree. This seems like overkill, given the other options.

Issue in creating Zip file using glob.glob

I am creating a Zip file from a folder (and subfolders). it works fine and creates a new .zip file also but I am having an issue while using glob.glob. It is reading all files from the desired folder (source folder) and writing to the new zip file but the problem is that it is, however, adding subdirectories, but not adding files form the subdirectories.
I am giving user an option to select the filename and path as well as filetype also (Zip or Tar). I don;t get any problem while creating .tar.gz file, but when use creates .zip file, this problem comes across.
Here is my code:
for name in (Source_Dir):
for name in glob.glob("/path/to/source/dir/*" ):
myZip.write(name, os.path.basename(name), zipfile.ZIP_DEFLATED)
myZip.close()
Also, if I use code below:
for dirpath, dirnames, filenames in os.walk(Source_Dir):
myZip.write(os.path.join(dirpath, filename) os.path.basename(filename))
myZip.close()
Now the 2nd code taks all files even if it inside the folder/ subfolders, creates a new .zip file and write to it without any directory strucure. It even does not take dir structure for main folder and simply write all files from main dir or subdir to that .zip file.
Can anyone please help me or suggest me. I would prefer glob.glob rather than the 2nd option to use.
Thanks in advance.
Regards,
Akash
Glob by design does not expand into subdirectories. It follows UNIX style path rules and expansions see the documentation for fnmatch for more information. If you want to get at the subdirectories you need to add it to the path. This example will get everything at one level down.
for name in (Source_Dir):
for name in glob.glob("/path/to/source/dir/*/*" ):
myZip.write(name, os.path.basename(name), zipfile.ZIP_DEFLATED)
myZip.close()
Doug Hellman has an excellent discussion here. If you are not using the pattern features of glob (like *.txt for all text files or *[0-9].txt for all text files that have a number before the extension) then I think your os.walk solution is better