├── .github ├── dependabot.yml └── workflows │ ├── build.yml │ └── lint.yml ├── .gitignore ├── .goreleaser.yaml ├── LICENSE.md ├── Makefile ├── README.md ├── go.mod ├── go.sum ├── main.go └── tree.txt /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gomod" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | time: "08:00" 8 | labels: 9 | - "dependencies" 10 | - package-ecosystem: "github-actions" 11 | directory: "/" 12 | schedule: 13 | interval: "daily" 14 | time: "08:00" 15 | labels: 16 | - "dependencies" 17 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | tags: 6 | - v* 7 | branches: 8 | - main 9 | pull_request: 10 | 11 | permissions: 12 | contents: read 13 | 14 | jobs: 15 | govulncheck: 16 | uses: caarlos0/meta/.github/workflows/govulncheck.yml@main 17 | with: 18 | go-version: stable 19 | semgrep: 20 | uses: caarlos0/meta/.github/workflows/semgrep.yml@main 21 | ruleguard: 22 | uses: caarlos0/meta/.github/workflows/ruleguard.yml@main 23 | with: 24 | go-version: stable 25 | unit-tests: 26 | runs-on: ubuntu-latest 27 | steps: 28 | - uses: actions/checkout@v4 29 | - uses: actions/setup-go@v5 30 | with: 31 | go-version: stable 32 | - name: test 33 | run: go test -v ./... 34 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: golangci-lint 2 | on: 3 | push: 4 | tags: 5 | - v* 6 | branches: 7 | - main 8 | pull_request: 9 | 10 | permissions: read-all 11 | 12 | jobs: 13 | golangci: 14 | name: lint 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v4 18 | - uses: actions/setup-go@v5 19 | with: 20 | go-version: stable 21 | - uses: golangci/golangci-lint-action@v7 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | full.json 3 | tree_ascii.txt 4 | freeze.png 5 | -------------------------------------------------------------------------------- /.goreleaser.yaml: -------------------------------------------------------------------------------- 1 | # This is an example .goreleaser.yml file with some sensible defaults. 2 | # Make sure to check the documentation at https://goreleaser.com 3 | 4 | # The lines bellow are called `modelines`. See `:help modeline` 5 | # Feel free to remove those if you don't want/need to use them. 6 | # yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json 7 | # vim: set ts=2 sw=2 tw=0 fo=cnqoj 8 | 9 | version: 2 10 | variables: 11 | description: Convert markdown lists into beautiful ASCII trees 12 | homepage: https://github.com/caarlos0/mdtree 13 | 14 | includes: 15 | - from_url: 16 | url: https://raw.githubusercontent.com/caarlos0/goreleaserfiles/main/build.yml 17 | - from_url: 18 | url: "https://raw.githubusercontent.com/caarlos0/goreleaserfiles/main/package.yml" 19 | - from_url: 20 | url: https://raw.githubusercontent.com/caarlos0/goreleaserfiles/main/release.yml 21 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2024 Carlos Alexandro Becker 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | default: 2 | wget -c https://raw.githubusercontent.com/charmbracelet/freeze/main/configurations/full.json 3 | mdtree --root ⋯ --style rounded tree_ascii.txt 4 | freeze -c ./full.json tree_ascii.txt 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mdtree 2 | 3 | Convert markdown lists into ASCII trees. 4 | 5 | ![screenshot](https://github.com/user-attachments/assets/e233ad76-2ee1-4395-a8be-88fabc551b67) 6 | 7 | For example, if you run: 8 | 9 | ```bash 10 | cat <