Docfd User Guide

Back to Docfd Main Page

Installation

Docfd is primarily distributed as statically linked binaries via GitHub Releases

Refer to the Installation section for other distribution channels.

Getting Started

We will use the Docfd Engineering pages of this GitHub site for this walkthrough, which can be cloned by:

$ git clone https://github.com/darrenldl/darrenldl.github.io.git

But feel free to use any local directory as Docfd is fully offline and does not modify or move your documents.

Startup

$ cd darrenldl.github.io/
$ docfd
Figure: Docfd TUI Overview at Startup

Useful tip about looking up key bindings:

Filtering

Steps:

Figure: Docfd TUI After Filtering Step 2
Figure: Docfd TUI After Filtering Step 2
Figure: Docfd TUI After Filtering Step 5

Dropping

To keep the UI less cluttered, it’s often useful to “clear the table” and just focus on the documents at hand with input fields ready for new filter or search criteria.

Steps:

Figure: Docfd TUI After Dropping Step 1
Figure: Docfd TUI After Dropping Step 3

Searching

Steps:

Figure: Docfd TUI After Searching Step 3
Figure: Docfd TUI After Searching Step 5
Figure: Docfd TUI After Searching Step 6

Undo/redo

Steps:

Note that as Docfd only stores a limited number of session snapshots at a time, sometimes undoing or redoing requires recomputation of search or filter results and can take a bit longer.

Editing Command History

If you want to undo in bulk, add new actions, or just look at the actions done in the session thus far, you can make use of the command history editing functionality.

Steps:

Figure: Docfd TUI After Command History Step 1
Figure: Docfd TUI After Command History Step 2
Figure: Docfd TUI After Command History Step 3
Figure: Docfd TUI After Command History Step 4

What to Try Next

Docfd Script

If you often repeat some search or repeat some starting steps for a particular project, you may find the scripting capability handy. Docfd script follows the same format as the command history

Steps to save a script:

Figure: Docfd TUI After Docfd Script Saving Step 1

Steps to open a script:

Figure: Docfd TUI After Docfd Script Opening Step 1

Steps to delete a script:

Figure: Docfd TUI After Docfd Script Deletion Step 2

Common Cli Arguments

Here we list some common cli arguments that you may find useful.

Limit to just specific extensions, e.g. .md, .txt:

Add onto the default list of extensions, e.g. .js:

Scan by globbing:

Use list of paths from other programs, e.g. fd:

Config File

Location

Docfd looks up the config file in the following order:

Note that only one config file is picked, i.e. there is no merging of cli arguments from multiple config files.

Typical usage would be a .docfd-config at the project root for project specific configurations.

Format

Docfd config file uses the “one cli argument per line” format. For instance, if we are to store one of the examples from previous section into a config file, we would have:

--exts
md,txt

or

--exts=md,txt

Special Tokens

Example usage with a .docfd-config file at the root of a project folder:

--data-dir
<CONFIG_DIR>/.docfd/data
--cache-dir
<CONFIG_DIR>/.docfd/cache

Docfd provides a quick way to open and copy links within a document. We will use the design-context.md file from engineering directory for this.

Steps:

Figure: Docfd TUI After LINKS Step 2

Types of links currently supported are:

Troubleshooting

Debug Log

You can enable debug log via:

$ docfd --debug-log FILE

where FILE is the log file for Docfd to output to.

When you might need this:

Note that the debug log is not very structured as it’s only intended for ad hoc diagnostics.

Cache Directory Location

You can find the cache directory location in the help message:

$ docfd --help=plain | grep -- --cache-dir

When you might need this:

Data Directory Location

You can find the data directory location in the help message:

$ docfd --help=plain | grep -- --data-dir

When you might need this:

References