summaryrefslogtreecommitdiff
path: root/tissue/web
AgeCommit message (Collapse)Author
2022-12-25web: dev: Accept thunk to read project configuration.Arun Isaac
To the development server, pass a thunk to read project configuration instead of the project configuration itself. This allows us to hack on the project's tissue.scm without having to restart the development server to see changes. * bin/tissue (tissue-web-dev): Pass thunk to read project configuration instead of the project configuration itself. * tissue/web/dev.scm (handler, start-dev-web-server): Accept thunk to read project configuration instead of the project configuration itself.
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-12-24bin: Pass along entire project configuration object to servers.Arun Isaac
Themes should be free to access the entirety of the project configuration. It is impossible to predict which parts of the project configuration they will need. * bin/tissue (tissue-web, tissue-web-dev): Pass entire configuration object to start-web-server and start-dev-web-server respectively. * tissue/web/dev.scm: Import (tissue tissue). (handler, start-dev-web-server): Accept entire configuration object. * tissue/web/server.scm: Import (tissue tissue). (search-handler, start-web-server): Accept entire configuration object.
2022-12-24web: Move query string utilities.Arun Isaac
* tissue/web/server.scm (query-parameters, query-string): Move to ... * tissue/utils.scm: ... here. Import (ice-9 match) and (web uri).
2022-12-24dev: Implement development web server.Arun Isaac
* tissue/web/dev.scm: New file.
2022-12-24server: Factor out reusable parts into separate functions.Arun Isaac
The newly factored out functions will be used in the upcoming development web server. * tissue/web/server.scm (handler): Factor out reusable parts into ... (log-request, mime-type-for-extension, 404-response, search-handler, try-paths): ... new functions.
2022-11-28web: server: Do not prepend / to URI path.Arun Isaac
* tissue/web/server.scm (handler): Do not prepend / to URI path.
2022-11-28web: server: Serve path/index.html if path ends in /.Arun Isaac
* tissue/web/server.scm (handler): Serve path/index.html if path ends in /.
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-24web: server: Use small caps for document type identifiers.Arun Isaac
* tissue/web/server.scm (%css)[.document-type]: Remove text-transform property. Set font-variant property.
2022-07-24web: server: Style document type identifiers without color.Arun Isaac
* tissue/web/server.scm (%css)[.document-type]: Remove font-size, padding, background-color and color properties. [.open-issue-document-type]: Remove background-color property.
2022-07-23web: server: Use default font size for search result titles.Arun Isaac
* tissue/web/server.scm (%css)[.search-result a]: Remove font-size property.
2022-07-23web: server: Remove special line height for search hints.Arun Isaac
* tissue/web/server.scm (%css)[.search-hint]: Remove line-height property.
2022-07-21web: server: Be unaware of the state directory.Arun Isaac
The server should be unaware of the specifics of the state directory and its directory structure. It should be explicitly passed paths to all necessary directories. This way, the server can be repurposed for other applications such as the development web server---something that is coming soon in the subsequent commits. * tissue/web/server.scm (handler): Remove state-directory argument. Use directory paths in hosts argument. (start-web-server): Remove state-directory argument. Do not pass on state-directory to handler. * bin/tissue (tissue-web): Pass directory paths explicitly to start-web-server in hosts argument. Do not pass the removed state-directory argument.
2022-07-20web: server: Add article 'the' in handler docstring.Arun Isaac
* tissue/web/server.scm (handler): Add article 'the' in docstring.
2022-07-20web: server: Respond to a static file request with a bytevector.Arun Isaac
If the response to a static file request is returned as a procedure, (web server) tries to interpret the response as text. This results in encoding errors with binary files. Fixing this is not worth the trouble since (tissue web server) is anyway not meant to serve large static files. Large static files should be served using a more capable server such as nginx. * tissue/web/server.scm (handler): Return response to a static file request as a bytevector, instead of as a procedure.
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-19web: server: Remove rounded edges on search filters.Arun Isaac
* tissue/web/server.scm (%css)[.search-filter]: Remove rounded edges.
2022-07-19web: server: Remove rounded edges on tags.Arun Isaac
* tissue/web/server.scm (%css)[.tag a]: Remove rounded edges and reduce padding.
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-19web: server: Link to Xapian::QueryParser syntax documentation.Arun Isaac
* tissue/web/server.scm (make-search-page): Link to upstream Xapian::QueryParser syntax documentation.
2022-07-19file-document: Show created and last updated dates in listings.Arun Isaac
* tissue/file-document.scm (print, document->sxml): Show created and last updated dates in listings. * tissue/web/server.scm (%css): Put DOC identifier before metadata, not before title.
2022-07-19web: server: Parse provided search query only once.Arun Isaac
* tissue/web/server.scm (matches): Accept parsed search query. (handler): Parse provided search query only once.
2022-07-19search: Sort by date on strictly boolean queries.Arun Isaac
* issues/sort-by-date.gmi: Close issue. * tissue/search.scm (term-ref, query-terms-every): New functions. (boolean-query?): New public function. (search-fold): Sort by date on strictly boolean queries. * tissue/web/server.scm (handler): Sort by date on strictly boolean queries.
2022-07-13web: static: Do not log output directory name when building.Arun Isaac
The output directory is usually a randomly named temporary directory. Logging it is leaking an implementation detail. * tissue/web/static.scm (build-website): Do not log output directory name.
2022-07-11web: server: Summarize number of results by type.Arun Isaac
* tissue/web/server.scm (%css)[.search-results-statistics, .search-results-statistics li, .search-results-statistics a, .current-search-type]: New rules. * tissue/web/server.scm (make-search-page): Summarize number of results by type. (query-string, matches): New functions. (handler): Pass the number of matches by type to make-search-page. * issues/add-links-to-filter-documents-by-type.gmi: Close issue.
2022-07-09commit: Index commit messages too.Arun Isaac
* tissue/commit.scm: New file. * tissue/web/server.scm (%css)[.search-result-commit]: Add COMMIT marker. * bin/tissue: Import (tissue commit). * tissue.scm (#:indexed-documents): Add commits. * issues/index-commit-messages.gmi: Close issue.
2022-07-08web: server: Serve html files even without the html extension.Arun Isaac
* tissue/web/server.scm (handler): Serve html files even if they don't have the html extension.
2022-07-05tissue: Deprecate tag listings configuration.Arun Isaac
* tissue/tissue.scm (<tissue-configuration>)[web-tags-path]: Delete field. * tissue/tissue.scm (tissue-configuration): Remove web-tags-path argument. * tissue/web/static.scm (build-website): Remove tags-path documentation in docstring.
2022-07-05web: server: Serve static files too.Arun Isaac
* tissue/web/server.scm: Import (srfi srfi-171) and (ice-9 filesystem). (%mime-types): New variable. (handler): Serve static files too.
2022-07-05web: server: Error out on unknown host.Arun Isaac
* tissue/web/server.scm: Import (rnrs conditions) and (rnrs exceptions). (handler): Error out on unknown host.
2022-07-05web: server: Pass state directory to web server.Arun Isaac
* tissue/web/server.scm: Import (git) and (tissue git). (handler, start-web-server): Accept path to state directory instead of to the xapian index. * bin/tissue (tissue-run-web): Pass state directory to start-web-server.
2022-07-04web: static: When building website, accept port to log to.Arun Isaac
* tissue/web/static.scm (build-website): Accept log-port argument specifying port to log to.
2022-07-04web: static: Deprecate mkdir-p in favor of guile-filesystem.Arun Isaac
* tissue/web/static.scm: Import (ice-9 filesystem). (mkdir-p): Delete function. (build-website): Use make-directories instead of mkdir-p. Remove TODO note about using guile-filesystem.
2022-07-03conditions: Deprecate &issue-file-not-found-error.Arun Isaac
The &issue-file-not-found-error cannot occur anymore now that we are reading files directly from the git repository and not from the working tree. * tissue/conditions.scm: Delete file. * bin/tissue, tissue/web/server.scm, tissue/web/static.scm: Do not import (tissue conditions). * bin/tissue (main): Do not guard against &issue-file-not-found-error conditions.
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-07-01web: server: Make CSS a host-specific parameter.Arun Isaac
* bin/tissue (tissue-run-web): Pass CSS as a host-specific parameter. * tissue/web/server.scm (handler): Remove css argument. Accept CSS as a host-specific parameter. (start-web-server): Remove css argument.
2022-06-30web: server: Support virtual hosts.Arun Isaac
* bin/tissue (tissue-run-web): Add hosts configuration option. * tissue/web/server.scm: Import (tissue utils). (start-web-server): Add host parameters argument. (handler): Read database based on Host header.
2022-06-30web: server: Grant read-write permissions to all on Unix socket.Arun Isaac
* tissue/web/server.scm (start-web-server): Grant read-write permissions to all on Unix socket.
2022-06-30web: server: Make CSS representationally more concise.Arun Isaac
* tissue/web/server.scm (%css): Make CSS representationally more concise by removing blank lines and squeezing one-rule blocks into a single line.
2022-06-30web: server: Do not pad search results.Arun Isaac
* tissue/web/server.scm (%css)[.search-results]: Do not pad.
2022-06-30web: server: Add class to search results ul list.Arun Isaac
* tissue/web/server.scm (make-search-page): Add class "search-results" to search results ul.
2022-06-30web: server: Display estimated number of matches.Arun Isaac
* tissue/web/server.scm: Import (xapian wrap). Import parse-query from (xapian xapian) renaming it to xapian:parse-query. (make-search-page): Display estimated number of matches. (handler): Pass estimated number of matches to make-search-page.
2022-06-30web: server: Re-indent make-search-page.Arun Isaac
* tissue/web/server.scm (make-search-page): Re-indent.
2022-06-29web: server: Self-document search filters.Arun Isaac
* tissue/web/server.scm (make-search-page): Self-document search filters. (%css)[.search-hint, .search-filter]: New rules.
2022-06-29web: server: List search results even on home page.Arun Isaac
* tissue/web/server.scm (handler): List search results even on home page.
2022-06-29web: server: Pre-fill search box with current query.Arun Isaac
* tissue/web/server.scm (make-search-page): Accept query argument. (handler): Pass query argument to make-search-page.
2022-06-29web: server: Add document type identifiers in web output.Arun Isaac
* tissue/web/server.scm (%css)[.search-result-title, .search-result-document, .search-result-issue, .search-result-open-issue, .search-result-closed-issue]: New rules.
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-29search: Accept search query as a single string.Arun Isaac
* tissue/search.scm (search-fold, search-map): Accept search query as a single string instead of a list of strings. * bin/tissue (tissue-search): Pass a single search string to search-fold. * tissue/web/server.scm (handler): Pass a single search string to search-map.