This is the CLI tool to generate readme with structure of solved algorithmic problems of different sources.
go get github.com/malyusha/algome
- Download the latest Linux .gz archive from Releases page
- Extract the archive
- Move binary to desired directory (used in $PATH env variable)
- Set "execute" permissions for the binary
# Extract the archive
tar xf algome_0.0.1_linux_x86_64.tar.gz
# Move the binary
sudo mv algome /usr/local/bin
# Set permissions
sudo chmod +x /usr/local/bin/algome- Download the latest macOS archive from Releases page
- Extract the archive
- Move binary to desired directory (used in $PATH env variable)
- Set "execute" permissions for the binary
# Extract the archive
tar xf algome_0.0.1_darwin_x86_64.tar.gz
# Move the binary
sudo mv algome /usr/local/bin
# Set permissions
sudo chmod +x /usr/local/bin/algomeDownload the latest Windows .gz archive from Releases page
Source provider- source of problems (e.g. list of problems from LeetCode). Source provider is responsible for loading all problems from source. Once loaded, all problems are cached in JSON files to prevent unnecessary network requests.
Readme generation is based on JSON configuration provided via file. By default, CLI will look for
the file algome.conf.json inside of current directory. If no file is found, then the default
configuration is used.
The default configuration contains following JSON:
{
"output": "./",
"structure": {
"catalog": {
"map_attr": "id",
"base_dir": "./"
}
},
"sources": ["leetcode"],
"problems_cache_dir": "~/.algome/cache",
"templates_dir": null
}Let's look at each property of the configuration.
| name | type | description | default |
|---|---|---|---|
output |
string |
Output directory for index readme.md. Index readme is an index file for allsources of problems | ./ |
sources |
[]string |
Array of source names that are supported. For each of source separated readme is generated inside solutions directory. See supported sources | ["leetcode"] |
problems_cache_dir |
string |
Directory, where the cached problems of source are stored as JSON | ~/.algome/cache |
templates_dir |
string |
Templates directory. Allows to override markdown templates for readme files. See [supported templates](#Override templates). | null |
hide_unsolved |
bool |
Removes unsolved problems from final README of each source. Keeps only solved problems, listed for each source. | false |
There are multiple commands currently available for usage:
Initializes configuration file. Not required command. By default, the following configuration is used:
{
"structure": {
"catalog": {
"base_dir": "./"
}
},
"sources": ["leetcode"]
}Example
$ algome init
Generate readme files from available sources, specified in configuration.
hide-unsolved- keeps only solved problems in final README of each source.
Example
$ algome generate
leetcode- LeetCode problems provider.
It's possible to override templates used for readme generation. All templates are parsed using
GoLang text/template package.
To override template, place file with name matching with supported template names inside directory,
then specify that directory in configuration file as the value of property templates_dir.
Template names to override
source_markdown- template, responsible for problems of single source provider (e.g. LeetCode).index- index template, which contains list of sources with problems. It's an entrypoint readme of your repository.