Why the substitution |version| is not working on Sphinx - versioning

I'm new using Sphinx to document my work. I want do add the number version and release to my documentation in PDF.
In the conf.py file, a version variable is defined that we can use in the .rst files like such:
|version|
But its not working for me, i don't know if I doing something wrong. Any suggestions?

To use a substitution, you need to have it defined in the file in the format:
.. |Version| replace:: 1.0
Then use it in text:
"Latest version is |Version|"
I typically include all substitutions in a single file that is then included in each file in project with directive:
.. include:: substitutions-file-name

Related

Proper Batch Indentation in Sublime

I would like to know how to fix the syntax indentation for batch in ST3.
Currently, it only indents like the code below.
IF %num_args%==3 (
GOTO somewhere
GOTO somewhere_else
) ELSE (
ECHO some text
GOTO END
)
I checked the file Batch File.sublime-syntax but can't find a way to fix this.
Perhaps make some changes in this section?
parens:
- match: \(
scope: punctuation.section.group.begin.dosbatch
push:
- meta_scope: meta.group.dosbatch
- match: \)
scope: punctuation.section.group.end.dosbatch
pop: true
- match: ',|;'
scope: punctuation.separator.dosbatch
- include: expressions
if not where / what else can I do?
Indentation rules in Sublime aren't affected by the syntax definition outside of the syntax providing the scope that tells Sublime which rules to apply at any given point.
The rules for this are specified via tmPreferences style configuration files which contain the keys:
decreaseIndentPattern
increaseIndentPattern
disableIndentNextLinePattern
bracketIndentNextLinePattern
These keys represent regular expressions that indicate what the indent level should be based on the file content. A side effect of this system is that it can be hard to dial in exactly the indent that you want.
That said, the Batch File package that ships with Sublime doesn't contain any indentation rules by default. If that's the package that you're using for your batch file support, that would be why it's not indenting the way that you'd like.
If you're using that package, you would need to create a file with the relevant patterns in order for the file to be indented. In that case you could create an appropriate tmPreferences file and store it in your User package, as it's the scope specified in the file that determines which set of rules get used.
Alternatively if you're using a third party package, it may or may not have such a file in it, in which case you would either need to create one or override the existing one.
Creating one would still work the same as the above. If instead the third party package has some indent rules that you would like to tweak, the process is slightly different.
To override the file, use PackageResourceViewer to open the appropriate package file. If you use this package to open the file, any saves you make will automatically create an override that will make your file take precedence over the one in the package.
In the case that you need to create a file from scratch, the best course of action is to look at an existing package that is already doing this, to see how it's doing things.
The best course of action would be to find a package with a language as similar as possible in structure to the one you're working with to use as a base, although for a batch file I'm not sure if that's actually possible.
For illustration purposes, the Indentation.tmPreferences file that is included within the Shell Script package (which I erroneously made this answer about the first time) looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Indentation</string>
<key>scope</key>
<string>source.shell</string>
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
<string>^\s*(\}|(elif|else|fi|esac|done)\b)</string>
<key>increaseIndentPattern</key>
<string>(?x)
^\s*(elif|else|case)\b
| ^.*(\{|\b(do)\b)\s*$
| ^.*\bthen\b\s*$
</string>
<key>indentNextLinePattern</key>
<string>^.*[^\\]\\$</string>
<key>disableIndentNextLinePattern</key>
<string>^\s*then\s*$</string>
<key>bracketIndentNextLinePattern</key>
<string>^\s*if\b.*(?!\bthen\b)$</string>
</dict>
</dict>
</plist>
For your purposes you would need to alter the regular expressions as needed in order to hint to Sublime what the indent should be, as well as modifying the scope that the rules apply to.
There is a forum post on the Sublime Forum that describes how the indent rules are applied by Sublime.
Additionally, if you're using the shipped Batch File syntax, it may be worth logging an issue on the Sublime Packages Issue Tracker. The packages that ship with Sublime are open source and the community helps to maintain them.
As such it's possible that (with some discussion) the default package for batch files could be updated to support this directly.

Gamemaker export code for Gource

Is there a way to use Gamemaker with Gource?
Or is there something like a tool or library to export / convert .gmk files to .txt files each of them with one class?
While pre-Studio projects are stored as single files, you can use Gmk-Splitter to split the .gmk file into a number of XML files (not too unlike the format used by GameMaker: Studio) or recompose the file from a set.
While not ideal, this permits to use source control with older versions of GameMaker. See the author's "Gang-Garrison-2" repository for an example of that in action.
With .gmk it's impossible. But if you will use GMS then you can try do it, because GMS uses .xml (i.e. text) files. I checked it with git and mercurial and it works fine.

Vim doesn't recognize angular as HTML

I understand that vim would not know until told that some file maps to a particular type. Currently my VIM setting fails to recognize my .ng file as '.html' hence it reads it like a plain text.
I want to know the global command to enable that.
PS: I think my sytastic plugin is not working for the same reason.
Put this into your .vimrc
autocmd BufNewFile,BufRead *.ng set filetype=html

How to remove specific characters from a file name?

I have bunch of files that need to have a (.) dot removed from the file-name. Eg. "Mr.-John-Smith.jpg" to "Mr-John-Smith.jpg". I don't have real experience with programming and know only html/css and a little javascript. I found another identical question here on stackoverflow, but what I gathered it was fixed on linux system and BASH was used.
Anyways, if anyone could provide me a tutorial on which program to use for this and what code to execute in that program to make it happen I'd be grateful.
if you are using a windows environment (which i guess you do)
you can download this free utility to mass change file names !
main page :
http://www.bulkrenameutility.co.uk/Main_Intro.php
download page :
http://www.bulkrenameutility.co.uk/Download.php
its easy to use
enjoy
If your file names in a file...
1- Open Microsoft Word or any text editor. Press ctrl+h and then search "." without quotes then replace it with blank character.
2- It will remove all dots, again bring "." to your file extention such as .jpg , .png searh your file extention for example "jpg" and replace it with ".jpg"
It will works %100, i am using this method everytime.
if they are not in a file and if you want do somethings in your operation systems' file system
Try this program. It is very useful for this operation;
Download
To remove all except the extension dot from all files in a directory, you can use PowerShell that comes with newer versions of Windows, and can be downloaded for older versions;
Line breaks inserted for readability, this should go on one line;
PS> dir | rename-item -newname {
[System.IO.Path]::GetFileNameWithoutExtension($_.name).Replace(".","") +
[System.IO.Path]::GetExtension($_.name); }
What it does is to take the file name without an extension and remove all dots in it, and then add back the extension. It then renames the file to the resulting name.
This will change for example do.it.now to doit.now, or in your case, Mr.-John-Smith.jpg to Mr-John-Smith.jpg.

How to achieve symbol referencing across directories in vim?

Can ctags tag symbols from a directory up in the hierarchy also or is it limited to create tags for current and sub-directories only?
Basically I'm looking for Visual Studio like symbol cross referencing it is very helpful in understanding alien source code flow.
If not Vim, then which other editor should I use?
thanks
Ctags only recurses to subdirectories. But all you have to do is run ctags -R . in your project home directory, and it will create a tags file for your whole project.
You aren't limited to specifying one tags file in Vim. This is an alternative to the other answers; you can just do something like:
set tags=tags,~/wintags,c:/path/to/moretags/etc
So you don't need to take the time regenerating a monolithic tags file when you just want to update your local tags.
Regarding the OP's comment in another answer,
yes thats correct but when i open a file say proj/dir1/def.c and press ctrl+] on a function name which is defined say in proj/dir2/abc.c, I get tag not found :(
You could also create one tags file for all of your projects at the 'proj' root:
set tags=tags;c:/path/to/proj
This will use the first file named tags that it finds as it walks up the directory hierarchy from where you are.
You can combine these two techniques to have a project-local tags file and then a "global" tags file that isn't updated as often.
Whilst it's got similar user interface for asking it to do it's thing, so you need to actually specify "go down directories", I find that cscope is a very nice tool, whcih does everything that ctags does and a bit more.
ctags (well, exctags at least) can create tags for as many directory trees you want. Simply run
exctags -R dir1 dir2 ...
Then vim knows about all the symbols you need. For example, one of the directories could be /usr/include in addition to your own source directory.
Make sure to run vim path/to/file.c from the same directory you created the tags file in.

Resources