I want to properly format the directory tree diagram, like:
- /folder1
- /folder2
- /folder3
- file1
- file2
What markup should I use for this purpose?
If you have access to the Linux tree command you can do tree -Q --charset=ascii. (you can use cygwin under Windows) This is not the same as MTD's answer because you have to account for the output characters and quoting the filenames with spaces. If you don't use --charset=ascii you will get characters that Confluence can't handle.
tree -Q --charset=ascii
.
`-- "Folder 1"
|-- "Folder 2"
`-- "Folder 3"
|-- "File 1"
`-- "File 2"
3 directories, 2 files
Then place it in a code block on Confluence
I know I am digging up the subject, but I had the same question while writing documentation, and none of the proposed solutions suited me (like the author it seems). So for future reference, here another solution
Using only ascii characters to form the tree structure (│, ├, ─, └), and Shift + Enter between lines to reduce line spacing. It's quite visual
├─ folder1
│ ├─ subFolder1
│ ├─ subFolder2
│ ├─ subFolder3
│ └─ subFolder4
└─ folder2
Are you looking for something like below snapshot? If so, then this is how you can achieve this.
Type - (dash)and press space to create a bullet.
Press tab to create a child bullet point.
Press enter to add multiple bullet points and so on.
You can use toolbar icons to do the above formatting but it's easy for me to use keyboard hence provided you this approach.
You can learn more about text formatting in Confluence from Atlassian's documentation:
https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html#ConfluenceWikiMarkup-Lists
Thank you!
I've just used the Code Block macro and inserted plain text as in your question, or the output of tree -d .
Related
I have a set of files in a workspace which I want to reference from another directory, but I cannot find the syntax I need to use.
The example is:
Primary
|_______ First
| |_____ src
| |______ Cool_thing.rs
|_______ Second
|_____ src
|______ main.rs
I want to reference a struct in Cool_things from main.rs
In Primary's Cargo.toml I put:
[workspace]
members= ["First","Second", "Third"]
[dependencies.Second]
First= { path = "First" }
In the Cargo.toml in the Second directory I have
[dependencies]
First = { path = "../First" }
I have been trying things in my main.rs like:
extern crate First;
use First::Cool_things::Cool_things;
No variation of use or mod seems to allow me to reference the struct or impl or functions in mod Cool_things.
The problem was it needed a "lib.rs" in the First src directory. Basically, the documentation for rust seems to be a bit remiss in telling people if you want to use local-dependancies then you have to have a lib.rs file which lists all the mods you are planning to access. So the creation of a lib.rs in the First src directory, and listing "Mod Cool_things" would allow the other package to reference the mod files in that directory.
The cargo.toml files: Inserted in the question above had the correct paths and dependancies, the issue was all around the lack of a lib.rs file.
So if you are planning a multiple binary program, you'll need to remember to have a lib.rs file whenever you're breaking up your code and then accessing modules from other parts of the workspace.
I want to have my doxygen main page to list all my sub projects and refer to their respective README.md file.
In every subproject's CMakeLists.txt (each project is in its own subfolder) I call the function REGISTER_TARGET(my_project_name) which is defined as
macro(REGISTER_TARGET TARGET)
# Storing target name and directory as 2D-array
SET(GLOBAL_TARGETS "${GLOBAL_TARGETS};${TARGET}\;${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "source_list")
# doing other things concerning the build
...
endmacro(REGISTER_TARGET)
And in my doxygen's CMakeLists.txt I do
SET(DOXYGEN_GLOBAL_TARGETS "")
foreach(pair ${GLOBAL_TARGETS})
LIST(GET pair 0 local_project_name)
LIST(GET pair 1 local_project_dir)
SET(local_project_readme "${local_project_dir}/README.md")
LIST(APPEND DOXYGEN_FILES ${local_project_readme})
SET(DOXYGEN_GLOBAL_TARGETS "${DOXYGEN_GLOBAL_TARGETS}\n- ${local_project_name}. #ref ${local_project_readme}")
endforeach()
...
CONFIGURE_FILE("${DOXYGEN_MAINFILE_IN}" "${DOXYGEN_MAINFILE}" #ONLY)
And my DOXYGEN_MAINFILE_IN looks like
This is the main page
======
Sub projects
------------
#DOXYGEN_GLOBAL_TARGETS#
This turns out in DOXYGEN_MAINFILE as:
This is the main page
======
Sub projects
------------
- name_of_project1. #ref C:/very/ugly/source/path/name_of_project1/README.md
- name_of_project2. #ref C:/very/ugly/source/path/name_of_project2/README.md
which does not correctly link to this file (in HTML, the whole path is shown and the last path is rendered as hyperlink but refers to an empty file). The HTML for one entry looks similar to
<li>name_of_project1. C:/very/ugly/<a class="el" href="da/ddd/README_8md.html">source/path/name_of_project1/README.md</a></li>
So
a) how can I turn the absolute path to a markdown file in my to a working #ref target (which also displays the first header as link text). Keep in mind, that the above file paths are source-directory so the doc files will reside in a completely different place.
OR
b) which information do i have to serialize in my REGISTER_TARGET CMake macro which can then be turned in such a hyperlink.
I know that it is theoretically possible (OpenCV does it in a quite similar way but I failed to reproduce it)
The problem I'm having at the moment is that I simply wish to manage my list of source files by grabbing everything and removing the few odds and ends that I do not need. I was hoping that Cmake provided nice built-in tools for this.
So I might start with:
file(GLOB A "Application/*.cpp")
I feel like I want to create another list of files to be removed and I want to tell CMake: Remove from list A items that are in list B.
If this were Python I might do something like:
C = [f for f in A if f not in B]
I may have screwed that syntax up but I'm wondering if there is built-in support for managing these lists of files in a more elegant way?
Even if I could do something like my Python example, A is list of absolute paths so constructing B is clunky.
And why absolute paths anyway? It seems like this will break your build as soon as you relocate the source.
You can do that by using the list command with the REMOVE_ITEM option:
list(REMOVE_ITEM <list> <value> [<value> ...])
Have a look:
file(GLOB FOO *)
set (ITEMS_TO_REMOVE "item;item2;item3")
message(STATUS "FOO is ${FOO}")
list(REMOVE_ITEM FOO ${ITEMS_TO_REMOVE})
message(STATUS "FOO is now ${FOO}")
Keep in mind that the paths returned by file(GLOB) are absolute, you might want to build your list of items to remove by prepending ${CMAKE_CURRENT_LIST_DIR} to each one of them:
set (ITEMS_TO_REMOVE "${CMAKE_CURRENT_LIST_DIR}/item;
${CMAKE_CURRENT_LIST_DIR}/item2;
${CMAKE_CURRENT_LIST_DIR}/item3")
If you like Python, you can generate your list of source files with execute_process. There is also possiblity to work with lists.
But I would recommend you to "hardcode" your list of source files.
File command documentation states:
We do not recommend using GLOB to collect a list of source files from your source tree. If no CMakeLists.txt file changes when a source is added or removed then the generated build system cannot know when to ask CMake to regenerate.
I want an entry for release_notes.txt or release_notes.html in the start-menu. When I select the release_notes entry in the menu the text file shall apear in notepad or the html fill in a web browser. But I can't figure out how to write the commands in CMakeLists.txt to do that.
Are you using CPACK_NSIS_MENU_LINKS?
Or you could use CPACK_NSIS_EXTRA_INSTALL_COMMANDS...
Not sure if current versions of CMake provide an easier/different way, but this is what we do:
SET( CPACK_NSIS_CREATE_ICONS_EXTRA
"
CreateShortcut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\SDK Documentation.lnk\\\" \\\"$INSTDIR\\\\doc\\\\html\\\\index.html\\\"
" )
SET( CPACK_NSIS_DELETE_ICONS_EXTRA
"
Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\SDK Documentation.lnk\\\"
" )
Similar to Johannes' answer, CPACK_NSIS_CREATE_ICONS_EXTRA and CPACK_NSIS_DELETE_ICONS_EXTRA is a flexible way to manage shortcuts (Start menu, desktop, etc.), including adding command-line arguments if required. This short article gives a bit more information. It uses a slightly different path for the delete link with an explanation for why. It also includes links to NSIS documentation to show other places you can create shortcuts, etc.
From what I understand, the --strip option of groc (a docco fork) is to allow me to strip out folders from the documentation hierarchy. eg. I have a folder structure like:
src/
module1/
coffee/
submod1/
xxx.coffee
yyy.coffee
submod2
zzz.coffee
module2/
coffee/
submod1/
xxx.coffee
yyy.coffee
submod2
zzz.coffee
I want to exclude all coffee folders from the hierarchy of the docs. How do I use strip to do that? Its not really clear in the docs
I don't think you can achieve what you're looking for with the --strip option. I believe strip only allows you to strip from the beginning of the path. I've tried "*" glob pattern matching and I couldn't get your scenario to work (eg --strip coffee and --strip */coffee)
For general usage, I use strip like this:
groc **/*.js --strip modules/WebCommon/j2ee-apps/webcommon.war/javascript
# INPUT
# modules/WebCommon/j2ee-apps/webcommon.war/javascript/validator/validator.js
# OUTPUT
# validator/validator.js
However, the filename in the actual html file still holds the entire path. That's because the template uses projectPath and not targetPath for the title.
# "projectPath":"modules/WebCommon/j2ee-apps/webcommon.war/javascript/validator/validator.js","targetPath":"validator/validator"
Admittedly, Ian MacLeod (the author) agrees that it's confusing:
https://github.com/nevir/groc/issues/13