summaryrefslogtreecommitdiff
path: root/tissue/document.scm
AgeCommit message (Collapse)Author
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.
2022-12-27document: Support symbol serialization and deserialization.Arun Isaac
* tissue/document.scm (object->scm, scm->object): Support symbols.
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-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-19document: Store serialized date as value in Xapian document.Arun Isaac
* tissue/document.scm (document-recency-date): Declare public generic function. (document-term-generator): Store serialized date in slot 0 of Xapian document. * tissue/file-document.scm (document-recency-date): New generic method. * tissue/commit.scm (document-recency-date): New generic method.
2022-07-13document: Use string-blank?.Arun Isaac
* tissue/document.scm (document-snippet-source-text): Use string-blank?.
2022-07-13document: Tolerate unbound slots when serializing.Arun Isaac
* tissue/document.scm (object->scm): Drop unbound slots, do not raise an error.
2022-07-13document: Remove unnecessary import of (rnrs hashtables).Arun Isaac
* tissue/document.scm: Do not import (rnrs hashtables).
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-09bin: Move indexing document type into document-term-generator.Arun Isaac
* bin/tissue (index): Move indexing document type into document-term-generator generic function. * tissue/document.scm (document-term-generator): Index document type.
2022-07-09document: Make snippet source text extraction a generic function.Arun Isaac
* tissue/document.scm (document-snippet-source-text): New generic method. (document-html-snippet): Use document-snippet-source-text.
2022-07-09document: Prefix ID term with document type.Arun Isaac
We need to prefix the ID term in order to distinguish between future document types (such as the commit document type) that may not be based off a file. * tissue/document.scm (document-id-term): Prefix ID term with "file." indicating the document type.
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-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-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-29document: Remove blank line between title and snippet.Arun Isaac
* tissue/document.scm (print): Remove blank line between title and snippet.
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-29document: Remove blank lines in search snippets.Arun Isaac
Blank lines waste precious space in search snippets. * tissue/document.scm (document-html-snippet): Remove blank lines in search snippets.
2022-06-29document: Abstract out HTML snippet generation.Arun Isaac
* tissue/document.scm (document-html-snippet): New function. (document-snippet, document-sxml-snippet): Use document-html-snippet.
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: Add web-uri slot to <document> class.Arun Isaac
* tissue/document.scm (<document>)[web-uri]: New slot. * bin/tissue (main): Set web-uri slot before indexing document.
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-28document: Add slot-set utility.Arun Isaac
* tissue/document.scm (slot-set): New public function.
2022-06-28document: Override write to print object slots and values.Arun Isaac
* tissue/document.scm: Import (srfi srfi-1). (write): New generic method.
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-27document: Add <document> object.Arun Isaac
* tissue/document.scm: New file.