summaryrefslogtreecommitdiff
path: root/tissue/issue.scm
AgeCommit message (Collapse)Author
2023-04-15issue: Ignore preformatted blocks.Arun Isaac
* tissue/issue.scm (file-details): Ignore preformatted blocks. * tests/issue.scm ("Ignore preformatted block"): New test. * issues/ignore-preformatted-blocks-in-gemtext-parser.gmi: Close issue.
2023-04-15issue: Allow checkboxes without a space.Arun Isaac
* tissue/issue.scm (file-details): Allow checkboxes without a space. * tests/issue.scm ("Allow checkboxes without a space"): New test. * issues/allow-checkboxes-without-a-space.gmi: Close issue.
2023-01-29git: Deprecate call-with-file-in-git.Arun Isaac
Functions called by call-with-file-in-git may expect to read files directly off the filesystem. These functions are not all within the user's control and cannot be rewritten to do otherwise. It is more robust to provide a filesystem checkout of the git repository like these functions expect. In this commit, we deprecate call-with-file-in-git and replace calls to it with call-with-input-file. These invocations have been arranged such that they all happen at the top level of a repository checkout. * tissue/git.scm (call-with-file-in-git): Delete function. * .dir-locals.el (scheme-mode): Unregister it. * bin/tissue (tissue-show, load-config), tissue/file-document.scm (file-text, read-gemtext-document), tissue/issue.scm (read-gemtext-issue): Replace call-with-file-in-git with call-with-input-file. (pull, tissue-web): Call load-config from the top level of a repository checkout.
2023-01-29document: Inter snippet source text into the xapian index.Arun Isaac
We store snippet source text in a slot of the <document> class thus interring into the xapian index. This allows us to render search snippets using only the xapian index without referring back to the git repository. * tissue/document.scm (<document>)[snippet-source-text]: New slot. * tissue/document.scm (document-snippet-source-text): Delete method. (document-html-snippet): Remove blank lines from snippet source text before generating a snippet. * tissue/commit.scm (document-snippet-source-text): Delete method. (repository-commits): Initialize snippet-source-text. * tissue/skribilo.scm (fragment-text): New function. (document-fragment): Initialize snippet-source-text. (document-text): Use fragment-text. (document-snippet-source-text): Delete method. * tissue/file-document.scm (file-text): New function. (document-text): Use file-text. (read-gemtext-document): Initialize snippet-source-text. * tissue/issue.scm (read-gemtext-issue): Initialize snippet-source-text. * issues/skribilo-fragment-snippets-need-code-from-repo.gmi: Close issue.
2023-01-27issue: Stop exporting deleted function.Arun Isaac
* tissue/issue.scm: Do not export index-issue.
2023-01-26issue: Index names of people as non-boolean terms.Arun Isaac
Names of people as non-boolean since it may be required to match them partially. Think searching for "arun" when the full name is "Arun Isaac". * tissue/issue.scm (document-boolean-terms): Remove creator, last updater and assigned terms. (document-term-generator): New method. * tissue/search.scm (%boolean-prefixes): Move creator, lastupdater and assigned to ... (%boolean-prefixes): ... here.
2023-01-23issue: Remove unused import.Arun Isaac
* tissue/issue.scm: Do not import (git).
2023-01-23file-document: Set document type of <file-document> to document.Arun Isaac
Earlier, the document type returned was "file-document". It only seemed to work because xapian split them into two terms—"file" and "document". * tissue/file-document.scm (document-type): Return "document". * tissue/issue.scm (document-type): New generic method.
2023-01-23issues: Allow checkboxes without a space.Arun Isaac
* issues/allow-checkboxes-without-a-space.gmi: New file. * tissue/issue.scm (file-details): Add TODO note.
2022-12-25web: Implement themes for the search page.Arun Isaac
We factor out all display related code to a theming module, and support powerful user customization of the theme thanks to generic functions. * tissue/commit.scm (document->sxml): Move to (tissue web themes default). * tissue/document.scm (document->sxml): Move to (tissue web themes default). * tissue/file-document.scm (document->sxml): Move to (tissue web themes default). * tissue/issue.scm (sanitize-string, document->sxml): Move to (tissue web themes default). * tissue/tissue.scm: Import (tissue web themes default). (<tissue-configuration>)[web-search-renderer]: New field. (tissue-configuration-web-search-renderer): New function. (tissue-configuration): Accept web-search-renderer argument. * tissue/web/server.scm: Import (oop goops) and (tissue web themes). Do not import (tissue document). (%css, make-search-page, search-handler): Move to (tissue web themes default). * tissue/web/themes.scm, tissue/web/themes/default.scm: New files. * Makefile (sources): Add $(top_level_module_dir)/web/themes/*.scm.
2022-10-07tissue: Markup docstrings in texinfo syntax.Arun Isaac
* tissue/document.scm (slot-set): Markup docstring in texinfo syntax. * tissue/file-document.scm (read-gemtext-document): Markup docstring in texinfo syntax. * tissue/git.scm (git-tracked-files): Markup docstring in texinfo syntax. * tissue/issue.scm (read-gemtext-issue): Markup docstring in texinfo syntax. * tissue/tissue.scm (gemtext-files-in-directory): Markup docstring in texinfo syntax. * tissue/web/static.scm (exporter, copier, gemtext-exporter, skribe-exporter): Markup docstrings in texinfo syntax.
2022-07-19web: server: Move document type identifier into HTML.Arun Isaac
* tissue/commit.scm (document->sxml): Generate document type identifier. * tissue/file-document.scm (document->sxml): Generate document type identifier. * tissue/issue.scm (document->sxml): Generate document type identifier. * tissue/web/server.scm (%css): Style document type identifiers.
2022-07-19issue: Render tags as an unordered list.Arun Isaac
* tissue/issue.scm (document->sxml): Render tags as an unordered list. * tissue/web/server.scm (%css): Style list items with tag classes, not anchor tags.
2022-07-19issue: Quote tags with spaces instead of hyphenating them.Arun Isaac
* tissue/issue.scm (document->sxml): Quote tags with spaces instead of hyphenating them.
2022-07-19document: Index boolean terms.Arun Isaac
Metadata that will be used in boolean filtering should be indexed as boolean terms, not as free text. This also results in the happy coincidence that we no longer need a specialized document-term-generator generic method for <issue> and <commit>. * tissue/document.scm (document-boolean-terms): New public generic function. (document-term-generator): Use document-boolean-terms. * tissue/issue.scm (document-boolean-terms): New generic method. (document-term-generator): Delete generic method. * tissue/commit.scm (document-boolean-terms): New generic method. (document-term-generator): Delete generic method.
2022-07-13issue: Move <issue> posts slot into <file-document>.Arun Isaac
We move the posts slot of <issue> into the <file-document> parent class as a commits slot. We also no longer store the creator, created-date, last-updater, last-updated-date of <issue> in slots. Rather, we compute them on-demand from the commits slot. * tissue/file-document.scm: Import (rnrs hashtables), (srfi srfi-1), (srfi srfi-26), (git), (tissue commit) and (tissue person). (<file-document>)[commits]: New slot. (file-document-creator, file-document-created-date, file-document-last-updater, file-document-last-updated-date): New public functions. (read-gemtext-document): Initialize commits slot. * tissue/issue.scm (file-modification-table-for-current-repository): Move to (tissue file-document). (<issue>)[creator, created-date, last-updater, last-updated-date, posts]: Delete slots. (<post>): Delete class. (document-term-generator, print, print-issue-to-gemtext, document->sxml): Use file-document-creator, file-document-created-date, file-document-last-updater, file-document-last-updated-date and file-document-commits instead of issue-creator, issue-created-date, issue-last-updater, issue-last-updated-date and issue-posts. (read-gemtext-issue): Use read-gemtext-document. Do not initialize creator, created-date, last-updater and last-updated-date slots.
2022-07-13document: Move <file-document> code to a new (tissue file-document).Arun Isaac
* tissue/document.scm: Do not import (srfi srfi-171). (<file-document>, document-type, document-id-term, document-text, document-term-generator, print, document->sxml, read-gemtext-document): Move to (tissue file-document). (document-id-term, document-text, print, document->sxml): Declare as generic functions. * tissue/file-document.scm: New file. * tissue/issue.scm, bin/tissue: Import (tissue file-document).
2022-07-09git: Use commit author date, not committer date.Arun Isaac
* tissue/git.scm (commit-author-date): New public function. (commit-date): Delete function. * tissue/issue.scm (read-gemtext-issue): Use commit-author-date instead of commit-date.
2022-07-09issue: Move person related functions to (tissue person).Arun Isaac
* bin/tissue: Import (tissue person). * tissue/issue.scm: Import (tissue person). (%aliases, resolve-alias, index-person!): Move to (tissue person). * tissue/person.scm: New file.
2022-07-09document: Generalize document-type method of <document> parent class.Arun Isaac
* tissue/document.scm (document-type): Generalize generic method of <document> to apply to most child classes. Pass on generic method of <file-document> to that of <document>. * tissue/issue.scm (document-type): Remove generic method for <issue> class.
2022-07-09issue: Hyphenate tag in search query if it has spaces.Arun Isaac
* tissue/issue.scm (document->sxml): Hyphenate tag in search query if it has spaces.
2022-07-08issue: Allow specifying tags with keyword and tag singulars.Arun Isaac
* tissue/issue.scm (file-details): Allow specifying tags with keyword and tag singulars.
2022-07-07issue: Parse known keys in list lines even if they are long.Arun Isaac
We drop the restriction that values in key-value pairs should be 2 words or less. Instead, if the key is a known key such as "keywords:", "tags:" or "status:", we always accept it as a key. * tissue/issue.scm (file-details): Parse known keys in list lines even if they are long. * tests/issue.scm ("Parse keywords even if they are long"): New test.
2022-07-07issue: Comment on list-line->alist cond ladder.Arun Isaac
* tissue/issue.scm (list-line->alist): Comment on cond ladder.
2022-07-07issue: Rename hashtable-append! to hashtable-prepend!.Arun Isaac
Even hashtable-append! was prepending, not appending. We change its name to suit. * tissue/issue.scm (hashtable-append!): Rename to hashtable-prepend!. (file-details): Call hashtable-prepend! instead of hashtable-append!.
2022-07-03issue: Use string-remove-prefix from (tissue utils).Arun Isaac
* tissue/issue.scm (list-line->alist, file-details): Use string-remove-prefix from (tissue utils). (file-details): Delete function.
2022-07-03tissue: Read files from git repository, not from the working tree.Arun Isaac
This also frees us from checking if the file actually exists in the working tree. * bin/tissue (tissue-show): Use call-with-file-in-git instead of call-with-input-file. (load-config): Use call-with-file-in-git and eval-string instead of load. * tissue/document.scm: Import (tissue git). (document-text, read-gemtext-document): Use call-with-file-in-git instead of call-with-input-file. * tissue/issue.scm (file-details): Read from a port instead of from a file. (read-gemtext-issue): Call file-details with a port reading the file committed into the git repository. * tissue/web/server.scm: Import (tissue git). * tissue/web/static.scm (exporter): Use call-with-file-in-git instead of call-with-input-file.
2022-06-29issue: Remove space at the beginning of search result metadata.Arun Isaac
* tissue/issue.scm (document->sxml): Remove space at the beginning of search result metadata.
2022-06-29document: Add search result title CSS class.Arun Isaac
* tissue/document.scm (document->sxml): Add search result title CSS class. * tissue/issue.scm (document->sxml): Add search result title CSS class.
2022-06-29document: Add CSS classes identifying document type.Arun Isaac
* tissue/document.scm (document->sxml): Add search-result-document class. * tissue/issue.scm (document->sxml): Add search-result-issue and search-result-open-issue/search-result-closed-issue classes.
2022-06-29document: Print identifier identifying type of search result.Arun Isaac
* tissue/document.scm (print): Print DOCUMENT identifier. * tissue/issue.scm (print): Print ISSUE identifier.
2022-06-29document: Accept port argument when printing to text.Arun Isaac
* tissue/document.scm (print): Accept port argument. * tissue/issue.scm (print): Accept port argument.
2022-06-29web: server: Use div instead of span for snippets and metadata.Arun Isaac
A div is already a block element. There is no need to use a span and then make it a block element. * tissue/document.scm (document->sxml): Use div instead of span for snippets and metadata. * tissue/issue.scm (document->sxml): Use div instead of span for snippets and metadata. * tissue/web/server.scm (%css)[.search-result-metadata]: Remove "display: block" property.
2022-06-29web: server: Add web server for search.Arun Isaac
* tissue/web/server.scm: New file. * tissue/document.scm (document-sxml-snippet): New public function. (document->sxml): New generic method. * tissue/issue.scm: Import (web uri). (document->sxml): New generic method. * bin/tissue: Import (system repl server) and (tissue web server). (address->socket-address, tissue-run-web): New function. (print-usage): List `tissue run-web' subcommand. (main): Call tissue-run-web.
2022-06-29document: Abstract out document snippet selection.Arun Isaac
* tissue/document.scm: Import (htmlprag). (document-snippet): New public function. (print): Use document-snippet. * tissue/issue.scm (print): Use document-snippet.
2022-06-28web: static: Move sanitize-string to (tissue issue).Arun Isaac
* tissue/web/static.scm (sanitize-string): Move to tissue/issue.scm.
2022-06-28issue: Prefix ! to destructive function index-person.Arun Isaac
* tissue/issue.scm (index-person): Rename to index-person!. (document-term-generator): Update invocations of index-person.
2022-06-28issue: Deprecate unix-time->date utility.Arun Isaac
* tissue/issue.scm (unix-time->date): Delete function.
2022-06-28Migrate to GOOPS.Arun Isaac
* tissue/document.scm: Do not import (srfi srfi-9). Import (srfi srfi-19), (ice-9 match) and (oop goops). (<document>): Delete type. (<document>, <file-document>): New classes. (date->alist, alist->date, object->scm, scm->object): New functions. (document->alist, alist->document, print-document): Delete functions. (document-term-generator, document-type, document-id-term, document-text, print): New generic methods. (read-gemtext-document): Return <file-document> object. (index-document): Delete function. * tissue/issue.scm: Do not import (srfi srfi-9) and (srfi srfi-19). Import (oop goops) and (tissue document). (date->iso-8601, iso-8601->date): Move to tissue/document.scm. (<issue>, <post>): Re-implement as class. (issue->alist, post->alist, alist->issue, alist->post, index-issue): Delete functions. (print-issue): Rename to print, a generic method. (print): Use document-title and file-document-path instead of issue-title and issue-file respectively. Accept mset argument. (print-issue-to-gemtext): Use document-title instead of issue-title. (read-gemtext-issue): Return a <issue> object. (document-term-generator): New generic methods. * bin/tissue: Import (tissue document) without a prefix. (print-document, alist->document, document->text, index-document): Delete functions. (tissue-search): Use the print generic function. (main): Use the document-type, document-id-term, document-term-generator generic functions and replace-document! instead of index-document. * tissue/conditions.scm (&unknown-document-type-violation): Delete condition.
2022-06-27issue: Move issue printing functions to (tissue issue).Arun Isaac
* bin/tissue: Do not import (srfi srfi-19). (print-issue, print-issue-to-gemtext): Move to tissue/issue.scm. (human-date-string): Move to tissue/utils.scm. * tissue/issue.scm: Import (term ansi-color). * tissue/utils.scm: Import (srfi srfi-19).
2022-06-27issue: Replace issues thunk with read-gemtext-issue reader.Arun Isaac
* tissue/issue.scm (%issue-files): Delete parameter. (issues): Delete function. (read-gemtext-issue): New public function. (file-modification-table-for-current-repository): New function. * bin/tissue (main): Do not parameterize %issue-files.
2022-06-27issue: Deprecate authors function.Arun Isaac
The authors function, if required in the future, must be reimplemented using guile-git in (tissue git). * tissue/issue.scm (authors): Delete public function.
2022-06-26issue: Index issues with type:issue.Arun Isaac
* tissue/issue.scm (issue->alist): Add (type . issue) pair. (index-issue): Index type:issue.
2022-06-26issue: Export predicates issue? and post?.Arun Isaac
* tissue/issue.scm: Export record type predicates issue? and post?.
2022-06-25bin: Index issues using xapian.Arun Isaac
* bin/tissue: Import (ice-9 ftw), (git), (xapian wrap) and (xapian xapian). (delete-xapian-index): New function. (%state-directory, %xapian-index): New variables. (main): Build index if it does not exist. * tissue/issue.scm: Import (xapian xapian). (index-person): New function. (index-issue): New public function.
2022-06-25issue: Add serialization and deserialization functions.Arun Isaac
* tissue/issue.scm (date->iso-8601, iso-8601->date): New functions. (issue->alist, post->alist, alist->issue, alist->post): New public functions.
2022-06-23issue: Lookup commits affecting file using guile-git.Arun Isaac
* tissue/git.scm: Import (rnrs hashtables) and (ice-9 match). (commit-deltas): New function. (file-modification-table): New public function. * tissue/issue.scm: Import (git). (file-details): Do not lookup git history for file using `git log'. (issues): Use file-modification-table to lookup git history.
2022-06-23issue: Remove relative date fields.Arun Isaac
* tissue/issue.scm (<issue>)[created-relative-date, last-updated-relative-date]: New fields. * tissue/issue.scm (<post>)[post-relative-date]: New field. * tissue/issue.scm (file-details): Do not collect relative dates. (issues): Do not initialize created-relative-date and last-updated-relative-date fields.
2022-04-14tissue: Add #:issue-files configuration parameter.Arun Isaac
* tissue/tissue.scm: Import (tissue git). (<tissue-configuration>)[issue-files]: New field. (gemtext-files-in-directory): New function. (tissue-configuration): Add #:issue-files keyword argument. * tissue/issue.scm (%issue-files): New public parameter. (issues): Read issues only from files in %issue-files. * bin/tissue (main): Parameterize %issue-files.
2022-04-05git: Abstract out `git ls-files'.Arun Isaac
* tissue/git.scm: New file. * tissue/issue.scm: Import (tissue git). (issues): Use git-tracked-files.