{"id":20863334,"url":"https://github.com/howardabrams/textfile-notes","last_synced_at":"2026-04-24T17:02:42.635Z","repository":{"id":4680963,"uuid":"5827543","full_name":"howardabrams/textfile-notes","owner":"howardabrams","description":"Script to work with a directory of text files as a collection of \"notes\".","archived":false,"fork":false,"pushed_at":"2012-11-07T23:57:31.000Z","size":129,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T14:49:38.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/howardabrams.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}},"created_at":"2012-09-16T07:59:53.000Z","updated_at":"2020-07-19T11:10:07.000Z","dependencies_parsed_at":"2022-08-06T17:30:15.790Z","dependency_job_id":null,"html_url":"https://github.com/howardabrams/textfile-notes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/howardabrams/textfile-notes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardabrams%2Ftextfile-notes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardabrams%2Ftextfile-notes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardabrams%2Ftextfile-notes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardabrams%2Ftextfile-notes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/howardabrams","download_url":"https://codeload.github.com/howardabrams/textfile-notes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardabrams%2Ftextfile-notes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32232622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"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":[],"created_at":"2024-11-18T05:28:36.077Z","updated_at":"2026-04-24T17:02:42.598Z","avatar_url":"https://github.com/howardabrams.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Not sure if you've read the description about [my note taking\nsystem][1], but I thought that my `notes` script for analyzing text\nfiles might be useful to share.\n\nUsage\n-----\n\n    notes [-a] \u003caction\u003e [-r|-p] [-n \u003cnames\u003e] [-t \u003ctags\u003e] ...\n\nThis script searches through text files in the folder/directory: `~/Dropbox/Notes`\nas if they were *notes*. This script can help you search and manipulate them.\n\nThe first argument is an *action* that tells the script what to do:\n\n  * `list`     - Lists all of the note filenames. Useful with `-t` option.\n  * `find`     - Searches the notes that contain a particular string\n  * `view`     - Converts a markdown formatted note into HTML. Opens in browser.\n  * `all-tags` - List all of the tags used in all notes.\n  * `export`   - Export some notes as HTML into the directory: `~/Sites/Notes`\n\nThe command actions accept the following parameters:\n\n  * `-a \u003caction\u003e` for specifying the action or command to do.\n  * `-n \u003cname\u003e`   for working with files whose names match this argument\n  * `-t \u003ctags\u003e`   for working with files that have all the tags given\n  * `-d \u003cdir\u003e`    for specifying the export destination (overrides the `$NOTEDEST` environment variable)\n  * `-r`          for raw output format (full note names and whatnot)\n  * `-p`          for print-printing the output (trimmed filenames)\n\n\nInstallation and Setup\n-------------\n\nJust do the following three steps:\n\n  1. Install either the [Markdown][2] or [MultiMarkdown][3] scripts\n  2. Install the [OpenMeta][4] binary file.\n  3. Place the `notes` script (and other binaries) somewhere in your `$PATH`.\n\nI recommend adding the following to your `.bashrc` (or equivalent):\n\n    export NOTEDIR=$HOME/Dropbox/Notes\n    export NOTEDEST=$HOME/Sites/Notes\n\n    alias notes-find=\"notes -a find\"\n    alias notes-view=\"notes -a view\"\n    alias notes-list=\"notes -a list\"\n    alias notes-export=\"notes -a export\"\n\nThese alias make tab-completion a wee bit easier.\n\nUsing the Export Feature\n------------------------\n\nThe `-a export` feature takes the notes specified, turns them into HTML files,\nand places them (by default) in the `$HOME/Sites/Notes` directory. This makes\nthem available to be servered by your locally running web server.\n\nThe `notes` script looks for an *HTML template file* in `$HOME/.notes/template.html`\nand it should be a regular HTML file with the following strings. These will be\nsubstituted during export as follows:\n\n  * `{{TITLE}}` which will contain the file name (without extension)\n  * `{{BODY}}` to hold the contents of the note (formatted with markdown)\n  * `{{STYLES}}` to hold references to CSS stylesheets (see below)\n  * `{{SCRIPTS}}` to hold references to JavaScript files (see below)\n\nFor example:\n\n    \u003c!DOCTYPE html\u003e\n    \u003chtml\u003e\n      \u003chead\u003e\n        \u003ctitle\u003eNote: {{TITLE}}\u003c/title\u003e\n        \u003clink type=\"text/css\" href=\"css/styles.css\" rel=\"stylesheet\" /\u003e\n        \u003cscript src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n      {{STYLES}}\n      {{SCRIPTS}}\n      \u003c/head\u003e\n      \u003cbody\u003e\n        {{BODY}}\n      \u003c/body\u003e\n    \u003c/html\u003e\n\nI have found that when I export my notes, I like to style them based on the\ntags. This allows my `work` notes to look different than my `journal` notes.\n\nThe `{{SCRIPTS}}` and `{{STYLES}}` are created based on tags\nassociated with the note. For instance, let's suppose you have a note\ncalled \"Meeting Rooms.txt\" and it has two tags:\n\n  * `work`\n  * `meetings`\n\nIf you had created the following two files:\n\n  * `$HOME/Sites/Notes/js/work.js`\n  * `$HOME/Sites/Notes/css/work.css`\n\nThen a file called \"Meeting-Rooms.html\" (notice the dash for a space) would\nbe created and look like:\n\n    \u003c!DOCTYPE html\u003e\n    \u003chtml\u003e\n      \u003chead\u003e\n        \u003ctitle\u003eNote: Meeting Rooms\u003c/title\u003e\n        \u003clink type=\"text/css\" href=\"css/styles.css\" rel=\"stylesheet\" /\u003e\n        \u003cscript src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n        \u003clink type=\"text/css\" href=\"css/work.css\" rel=\"stylesheet\" /\u003e\n        \u003cscript type=\"text/javascript\" src=\"js/work.js\"\u003e\u003c/script\u003e\n      \u003c/head\u003e\n      \u003cbody\u003e\n        ...\n      \u003c/body\u003e\n    \u003c/html\u003e\n\nIt didn't create a link to `css/meetings.css` or `js/meetings.js` because\nthose files didn't exist.\n\nThis stylizing feature is helpful with the `-d` option that allows you to\nexport files into a different directory. Keep in mind that the stylesheets\nand scripts look in a `js` and `css` directory relative to this destination.\n\n\nOpenMeta Wrapper\n----------------\n\nI like the concept that meta data (like tags) can be stored with a file, but not\n*inside* the file. However, the interface to [OpenMeta][4] is quite crufty,\nso unless you use something like [Notational Velocity (Alt)][5] to set your\ntags, you might appreciate the [tagit][6] wrapper.\n\nTo use it, simply source it into your shell, e.g.\n\n    source $HOME/.notes/notes-tag-helper\n\nThis gives you the following commands:\n\n * `tags \u003cfile\u003e`      - Lists all the tags for a note (or other relative file)\n * `tag-clear \u003cfile\u003e` - Removes all tags from a note (or file)\n * `tag-add \u003ctag ...\u003e \u003cfile\u003e`   - Adds one or more tags to a note\n * `tag-set \u003ctag ...\u003e \u003cfile\u003e`   - Sets the tags to just the ones listed\n\n\nQuestions\n--------------\n\n*Why did you write them as shell scripts?*\n\nThese shell scripts are not very fast, but I wanted to make it easy\nfor anyone to fork, and adapt this script to new environments and\nusage style.\n\nThat said, if anyone wants to take the ideas and redo them in\nsomething faster, that'd be pretty cool.\n\n\nTasks\n-----\n\nWhat can you expect in the next revision? Probably:\n\n * I would like to make it easier to read the entire note from the\n   command line. Perhaps a `-f` option to compete with the `-r` and `-p`?\n\n * I need to re-write my script to gather up all of the tags used in all\n   notes and put them in a list. I find this pretty helpful at times.\n\n\n  [1]: http://www.howardism.org/Technical/My_Note_Taking_System.html\n  [2]: http://daringfireball.net/projects/markdown/\n  [3]: http://fletcherpenney.net/multimarkdown/\n  [4]: http://code.google.com/p/openmeta/\n  [5]: http://brettterpstra.com/project/nvalt/\n  [6]: master/notes-tag-helper","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowardabrams%2Ftextfile-notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhowardabrams%2Ftextfile-notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowardabrams%2Ftextfile-notes/lists"}