Is there an extension or something that could help me to visually represent the project tree structure of a large project folders (components)? For example if I have react/apps/components/... to export it to a structure graphical view something like this, directly from VSCode:
UPDATE: I have found a way to export project tree structure in textual format like shown below using project-tree VSCode extension, but it's still not what I was looking for. Maybe something to export this format to graphical?
├─ apps
│ ├─ one
│ │ ├─ a
│ │ ├─ b
│ │ ├─ c
Looking at the text representation you can export from VSCode, I think it would be easy to write a script that turns that text representation into a Mermaid graph.
Mermaid is a markdown-like language that allows you to create graphics using text.
The example that you provided could be translated into Mermaid's syntax:
graph LR
Apps --> One
One --> A
One --> B
One --> C
graph LR states that this is a graph that will be plotted from left to right.
Each A --> B line establishes a relationship between two elements that will be drawn.
I don't have enough reputation to post the resulting image, but you can open this site and paste the code to see it: https://mermaid.live/
Related
So I have been trialling Weblate using Docker, and pointing it at a Git repo with some .md files I want to localize. I believe a good way of doing this is to use po4a to first convert the .md (basically text) files to a Gettext .pot file then import these as individual components.
My main aim is to make the process as automated as possible but so far it looks like the steps will be something like this:
Convert from .md to .pot using po4a-getextize
Copy .pot file to .en.po file
Commit both files
Create new Component for this file in Weblate, manually putting in
the name of the '.pot' file
Add new languages to translate this Component to
Wait for translators to do their thing
Download all .po files
Convert back to original format with po4a-translate
Feels like I'm missing something with the way Weblate creates components... or how the .pot & .po files work together... ideally I'd like to automatically pick up and create Components when .potfile appear in the repo, then just set up some scripts outside Weblate to automate the conversion to/from the different file formats.
You can use component discovery or API to automatically create the components.
I have a project with a lot of .c files scattered.
They are pretty often doing things related to each other and as such i want to have them grouped in the resulting doxygen website. The problem is that the project has never used doxygen before, as such I cannot go into every file and add \addtogroup Group A in every file.
What i would like to to is to have a separate file where I could define the groupings, without modifying the source code. at least as a start. Is this possible?
Something like Groupings.dox
Which would contain the following:
File1 GroupA
File2 GroupA
File3 GroupB
Is there an elegant way how to include table from an external file in markdown document rendered by GitHub?
Non elegant solutions I can think of:
include it as image (this one is really really ugly)
use Rmarkdown and print table using R (wont be rendered by default)
Just to give a bit of explanation. I am using a set of README.md files in my git repository (hosted by GitHub), so it is really clear to browse repo online, because GitHub renders automatically README.md file in every subdirectory.
I am algorithmically generating summary tables that should be included in those documents. It would be way more elegant if that table could be read from external file, because I do not want to write scripts that will modify README.md files directly.
There is no way to include files within markdown. So you need a "preprocessing" stage to generate the markdown which is then shown on Github (or rendered with normal markdown tools).
What Github supports is a basic table layout, which you'd need to render:
Solution 1: scripting
You could add something like this to your README.md:
<!-- TABLE_GENERATE_START -->
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
<!-- TABLE_GENERATE_END -->
And then have a script which pulls in the external table, reformats it to match the github format and puts it between the two comment.
Solution 2: pandoc
Pandoc is a document converter framework with many possible inputs and outputs. If you're up to learn another tool you could
reformat you table into a markdown file using csv2table into table.md
create a readme_header.md and readme_footer.md with the markdown before/after the table
merge the three files with cat readme_header.md table.md readme_footer.md > REAME.md
Of course you can also do a mixture of both solutions, e.g. generate table.md using a script and merge using cat
Somehow I can't make emacs' ff-find-other-file to get my header file. Here is what I have (minimal example):
cd ~/tmp
mkdir test
cd test
mkdir -p src/a/b inc/a/b
echo "aaaa" > src/a/b/a.cpp
echo "bbbb" > inc/a/b/a.hpp
tree
gives:
.
├── inc
│ └── a
│ └── b
│ └── a.hpp
└── src
└── a
└── b
└── a.cpp
This is similar to my project structure.
emacs -Q src/a/b/a.cpp
Then copying this in *scratch* and executing it with C-x C-e:
(setq cc-search-directories '("." "../inc" "../inc/*" "../../inc/*" "../../../inc/*" "/usr/include"))
and running ff-find-other-file in buffer a.cpp, only results in a prompt in the minibuffer:
Find or create a.hpp in: ~/tmp/test/src/a/b/
C-h v on ff-search-directories returns cc-search-directories, and on cc-search-directories I get the list above.
I expect ff-find-other-file to look in ../../../inc/*, and find a.hpp. Why doesn't it?
Edit: it seems to be the recursive part that doesn't work here.
After:
cp inc/a/b/a.hpp inc/
a.hpp is found from a.cpp.
The help about ff-search-directories says:
The stars are not wildcards: they are searched for together with
the preceding slash. The star represents all the subdirectories except
`..', and each of these subdirectories will be searched in turn.
Note that this quote if from the help for ff-search-directories, while the list I modified is cc-search-directories. I can't see why that would make a difference though.
This and other threads on SO made me believe * would recursively search the directory tree. Wrong?
* represents every immediate sub-directory of its parent; nothing more.
The commentary has it worded slightly more clearly:
The star is not a general wildcard character: it just indicates that the subdirectories of this directory must each be searched in turn.
i.e. For this specific example I would expect "../../../inc/*/b" to work. Or indeed "../../../inc/*/*" (as you've ended up using).
See also https://stackoverflow.com/a/23662870/324105 and note in particular that you can define functions to dynamically generate the target file path(s).
I suspect you want the a/b to be determined based on the original path, so a function to return the appropriate path to the other file would be your best solution here.
Another options is to use Projectile and execute the projectile-find-other-file command. Since projectile knows about your project structure, it will match your cpp/h files automatically. It is a little slower than ff-find-other-file, but it seems to do the job pretty well.
Oh, the search turns out not to be recursive after all. These other questions and answers here made me misread the help (quoted in the question).
"Each of these subdirectories will be searched in turn", does not imply that their subdirectories also will be searched.
Since the depth of my tree is limited, I just modified my cc-search-directories:
(setq cc-search-directories '("."
"../inc" "../inc/*" "../../inc/*" "../../../inc/*"
"../../inc/*/*" "../../../inc/*/*/*"
"../src" "../src/*" "../../src/*" "../../../src/*"
"../../src/*/*" "../../../src/*/*/*"
"/usr/include" "/usr/local/include/*"))
Generates an HTML page with a link to image without image file:
man -Hfirefox 3 exit
Generates an HTML page with link and file, but it is empty (zero size).
Also generates the code for the table, but it is empty:
zcat /usr/share/man/man3/exit.3.gz | groff -mandoc -Thtml > exit.3.html
Generates an html page with table, but the characters are misinterpreted.
In addition, some attributes (bold or underlined) are lost to certain words:
man -P cat 3 exit | man2html > exit.3.html
What is considered as an image is in fact a table (man 3 exit):
┌──────────┬───────────────┬─────────────────────┐
│Interface │ Attribute │ Value │
├──────────┼───────────────┼─────────────────────┤
│exit() │ Thread safety │ MT-Unsafe race:exit │
└──────────┴───────────────┴─────────────────────┘
netpbm-10.69.02-1 package is installed.
How to generate the images (or table in text mode) with the second method?
EDIT:
It is also necessary to install the psutils package. In this case, the PNG is created.
The content of the table is then visible but with no bordure.
And there has undesirable characters.