{"id":18085017,"url":"https://github.com/coderofsalvation/d2x","last_synced_at":"2026-04-26T12:31:59.924Z","repository":{"id":146965091,"uuid":"322351428","full_name":"coderofsalvation/d2x","owner":"coderofsalvation","description":"d2x (=dir to x) is a cute bash utility which transforms a directory structure into something else (html etc) ","archived":false,"fork":false,"pushed_at":"2020-12-18T14:34:35.000Z","size":4904,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T00:13:51.928Z","etag":null,"topics":["bash","html","website"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderofsalvation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-17T16:29:28.000Z","updated_at":"2020-12-18T15:07:04.000Z","dependencies_parsed_at":"2023-05-05T23:47:59.992Z","dependency_job_id":null,"html_url":"https://github.com/coderofsalvation/d2x","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coderofsalvation/d2x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fd2x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fd2x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fd2x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fd2x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderofsalvation","download_url":"https://codeload.github.com/coderofsalvation/d2x/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fd2x/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32297893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","html","website"],"created_at":"2024-10-31T15:09:05.500Z","updated_at":"2026-04-26T12:31:59.908Z","avatar_url":"https://github.com/coderofsalvation.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://i.imgur.com/Wc1MguG.jpg)\n\nUltra simple map-a-directory-to-something-else ([SEE DEMO HERE](https://coderofsalvation.gitlab.io/d2x/))\n\n# Usage\n\n```\n$ wget \"https://raw.githubusercontent.com/coderofsalvation/d2x/master/d2x\"\n$ chmod 755 d2x\n$ d2x init        # optional: create example theme + src-folder\n$ d2x src html --server\n[x] copying theme/assets =\u003e html/assets\n[x] rendering src =\u003e html......[x] done\n[x] starting server at port 8000\nServing HTTP on 0.0.0.0 port 8000 ...\n$ ls html/*       # profit!\n```\n![](https://raw.githubusercontent.com/coderofsalvation/d2x/master/demo.gif)\n\n## features\n\n* simplicity / zero dependencies (just bash)\n* directory structure is the navigation\n* transparent urls: `src/foo.txt` will be accessible as `html/foo.txt` and `html/foo.txt.html`\n* easily to be used on embedded systems or to publish github/gitlab pages (see `.gitlab-ci.yml`)\n* template language is bash\n* easy writable plugins (in any language)\n* easy to host from a subdirectory (just run `echo 'https://foo.com/my/sub/folder' \u003e theme/url` like in `.gitlab.yml`)\n\n\u003e it only uses: cat sed find xargs test which grep ls\n\n## What is a theme?\n\nIn the theme-dir you just put your custom html + bashfunctions, to transform the input-files.\u003cbr\u003e\nLets take a look at the example theme:\n\n```\ntheme/assets                # here you can put stuff like stylesheet or images\ntheme/index.html            # master template\ntheme/title                 # textfile with inline shellscript \ntheme/foobar                # shellscript\ntheme/plugins/myplugin      # allows you to hook into d2x functions\n\ntheme/plugins/filetype/txt   \ntheme/plugins/filetype/png  # process every desirable extension here \ntheme/plugins/filetype/html\ntheme/plugins/filetype/....\n\ntheme/render                # a helper, to be able to do $( render another.html ) inside html \ntheme/rendermenu            # index.html calls by containing $( rendermenu )\n```\n\nCould it be any easier and unsafer?\nAbsolutely, the `index.html` even supports environvariables:\n\n```\n\u003chtml\u003e\n\t\u003chead\u003e\n\t\t\u003ctitle\u003e$(render title) $(foobar) $HOME\u003c/title\u003e\n\t\u003c/head\u003e\n\t\u003cbody\u003e\n\t\t $( rendermenu   )\n\n\t\t\u003cdiv class=\"content\"\u003e\n\t\t\u003c!-- content --\u003e \n\t\t\u003c/div\u003e\n\n\t\u003c/body\u003e\n\u003c/html\u003e\n```\n\nAnd this theme will basically process a given directory-structure (`src` in the example):\n\n```\nsrc/10 collection A/bar.html\nsrc/10 collection A/foo.html\nsrc/10 collection A/textfile.txt\nsrc/20 collection B/flop.html\nsrc/20 collection B/shader.frag\nsrc/index.html\n```\n\nIn theory you could also use this to generate photoalbums, productlistings, source-code documentation etc!\n\n## Why\n\nNatural selection does [not always lead to greater complexity](https://www.newscientist.com/article/dn13617-evolution-myths-natural-selection-leads-to-ever-greater-complexity/).\u003cbr\u003e\nNot being stuck in a rut (of zillion dependencies) is bliss.\n\n## Inspiration / similar simplicity tools\n\n* [Expose](https://github.com/Jack000/Expose)\n* [ssg](https://www.romanzolotarev.com/ssg.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Fd2x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderofsalvation%2Fd2x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Fd2x/lists"}