Compare commits

..

262 Commits

Author SHA1 Message Date
fluxcdbot
b3929f22f3 CI: autofix rust code.
Some checks failed
clippy Build clippy has failed
format Build format has succeeded
rust-test Build rust-test has failed
build Build build has succeeded
2025-08-31 22:24:16 +00:00
Tom Alexander
bad12160ac Let chains have been stabalized.
Some checks are pending
clippy Build clippy has started
format Build format has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-08-31 18:22:06 -04:00
Tom Alexander
c43679fda9 Switch to local-path-provisioner.
Some checks failed
build Build build has started
clippy Build clippy has failed
rust-test Build rust-test has failed
format Build format has failed
2025-08-31 17:53:10 -04:00
Tom Alexander
9cc28f6f0d Merge branch 'unlisted_posts'
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-02-23 12:12:43 -05:00
Tom Alexander
d2256b8333 Add publish filter to blog posts and pages.
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
2025-02-23 12:08:43 -05:00
Tom Alexander
fa8753077a Add support for unlisted posts.
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
2025-02-23 12:02:14 -05:00
Tom Alexander
0420f58d02 Add a hover effect to the home link in the page header.
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-02-22 23:16:18 -05:00
Tom Alexander
0250aa106e Merge branch 'about_me'
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-02-22 22:54:18 -05:00
Tom Alexander
ca1c456571 Pass the nav links in the PageHeader render context.
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
2025-02-22 22:49:59 -05:00
Tom Alexander
4403980e2e Add a me link to the nav bar. 2025-02-22 22:36:42 -05:00
Tom Alexander
dbfbce955d Merge branch 'tracing'
Some checks are pending
clippy Build clippy has started
format Build format has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-02-22 21:12:44 -05:00
Tom Alexander
2e08d2e59a Set up tracing. 2025-02-22 21:12:33 -05:00
Tom Alexander
9f14534c10 Merge branch 'source_code_highlighting'
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-02-22 19:56:47 -05:00
Tom Alexander
4e34ebc29e Reformat css.
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
2025-02-22 19:45:04 -05:00
Tom Alexander
8d85d5ef79 Fix clippy.
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
2025-02-22 19:42:24 -05:00
Tom Alexander
7d73a3c948 Clean up. 2025-02-22 19:24:05 -05:00
Tom Alexander
c501f7cedc Add syntax highlighting for bash.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
2025-02-22 19:07:56 -05:00
Tom Alexander
41927764fc Continue highlights across code block lines. 2025-02-22 18:45:20 -05:00
Tom Alexander
75a763569b Disable ligatures in all code areas. 2025-02-22 18:27:45 -05:00
Tom Alexander
c67eb32774 Add more colors to python. 2025-02-22 18:26:33 -05:00
Tom Alexander
04952895cf Add support for highlighting python based on the nix highlighter. 2025-02-22 17:56:56 -05:00
Tom Alexander
749f6d7a55 Dynamically register which CSS files are needed. 2025-02-22 17:28:24 -05:00
Tom Alexander
c4cf814f8d Also add highlighting for paths. 2025-02-22 16:55:53 -05:00
Tom Alexander
3245e830d2 Assign more colors. 2025-02-22 16:46:47 -05:00
Tom Alexander
57eb1b81ec Start assigning colors. 2025-02-22 16:35:05 -05:00
Tom Alexander
c601c8697a Start a language-specific css file for highlight colors. 2025-02-22 16:25:36 -05:00
Tom Alexander
4ea1a46705 Update dust templates to support the new source code block format. 2025-02-22 16:13:23 -05:00
Tom Alexander
4cc04bda46 Update the render context to use the new src block format. 2025-02-22 16:04:47 -05:00
Tom Alexander
7e934cd360 Removed the enum and made plain src blocks just highlighted src blocks with only plain text in them. 2025-02-22 15:55:16 -05:00
Tom Alexander
e34e2ef75f Implement the highlighted src intermediate format.
I am going to remove the enum because I realized plain src blocks can just be highlighted src blocks with only RawText entries.
2025-02-22 15:44:45 -05:00
Tom Alexander
c067ca9cc8 Introduce an enum for a separate highlighted src block type. 2025-02-22 15:22:35 -05:00
Tom Alexander
b06424cb17 Initial highlighting code.
The dust auto-escaping is causing this naive approach to fail so I will have to create a distinction between highlighted code and not-highlighted code.
2025-02-22 15:09:00 -05:00
Tom Alexander
ae6f18d19c Center images when they are the only contents in a paragraph.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-02-22 13:15:58 -05:00
Tom Alexander
c371b999d5 Use the raw timestamp source for rendering timestamps.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-02-22 12:23:35 -05:00
Tom Alexander
073ac0ac25 Merge branch 'style_improvements'
Some checks failed
format Build format has succeeded
rust-test Build rust-test has succeeded
clippy Build clippy has failed
build Build build has succeeded
2025-02-18 07:19:25 -05:00
Tom Alexander
1c356737c1 Only add vertical padding for the top of the first blog post and use the same background color throughout.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
2025-02-17 22:32:38 -05:00
Tom Alexander
339bd433f6 Add slight padding the blog posts.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
2025-02-17 22:16:43 -05:00
Tom Alexander
bb5fa6a487 Swap site background and blog post background to give better contrast.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
2025-02-17 22:12:08 -05:00
Tom Alexander
71b6db14d5 Add a background color for stand-alone blog posts. 2025-02-17 22:08:46 -05:00
Tom Alexander
69fb91db37 Remove padding on blog stream posts.
It was causing an ugly tail on blog stream posts.
2025-02-17 22:00:33 -05:00
Tom Alexander
5fd93fc648 Allow line wrapping even when contiguous words are really long.
The code blocks were causing horizontal scrolling on mobile.
2025-02-17 21:29:43 -05:00
Tom Alexander
033a17e355 Increase home link font size. 2025-02-17 21:29:43 -05:00
Tom Alexander
824f34bd4c Make everything box-sizing: border-box. 2025-02-17 20:57:40 -05:00
Tom Alexander
d93e91c625 Increase the font size for inline source blocks to the normal font size.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
2025-02-17 20:54:56 -05:00
Tom Alexander
db21bd8a55 Restrict media to the size of its container.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
2025-02-17 20:49:36 -05:00
Tom Alexander
69729bd329 Include viewport meta tag. 2025-02-17 20:49:36 -05:00
Tom Alexander
ddea8fdceb Increase title font-size.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
2025-02-17 19:03:48 -05:00
Tom Alexander
71f639e503 Fix size of code blocks in headlines and make the line spacing more pleasant.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
build Build build has succeeded
rust-test Build rust-test has succeeded
2025-02-16 20:09:17 -05:00
Tom Alexander
8714d3b650 Increase the division between posts.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-02-16 17:39:21 -05:00
Tom Alexander
88064409a6 Add support for PNGs.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-02-16 15:46:26 -05:00
Tom Alexander
7c17087920 Show bold text as bold.
Some checks failed
clippy Build clippy has failed
rust-test Build rust-test has succeeded
build Build build has succeeded
format Build format has succeeded
2025-02-16 11:45:52 -05:00
Tom Alexander
c1837addd0 Remove unused variable.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
build Build build has succeeded
2025-02-08 22:05:22 -05:00
Tom Alexander
79c36476bd Merge branch 'render_images'
Some checks failed
rust-test Build rust-test has succeeded
format Build format has succeeded
clippy Build clippy has failed
build Build build has succeeded
2025-02-08 21:48:23 -05:00
Tom Alexander
4a0cbf3ba5 Do not copy a file if it already exists.
Some checks failed
format Build format has started
rust-test Build rust-test has started
clippy Build clippy has failed
2025-02-08 21:28:41 -05:00
Tom Alexander
59ee13345e Copy the images into the output. 2025-02-08 19:55:50 -05:00
Tom Alexander
bf7f37260c Mark the image files for copying. 2025-02-08 19:23:19 -05:00
Tom Alexander
ff478253c3 Generate render link based on path to file. 2025-02-08 19:14:08 -05:00
Tom Alexander
3e952ef0f4 Implement a macro for pushing the directory. 2025-02-08 18:37:32 -05:00
Tom Alexander
4e0f66401d Update the dependency manager file stack when rendering blog post pages. 2025-02-08 18:01:59 -05:00
Tom Alexander
3867f965d2 Add a dependency manager for render-time actions.
This will be used for supporting things like copying static files or rendering code blocks like gnuplot or graphviz.
2025-02-08 17:29:09 -05:00
Tom Alexander
5cac44c625 Store the path to the original source file in the blog post object. 2025-02-07 21:08:06 -05:00
Tom Alexander
463be34302 Async closure is now stable. 2025-02-07 20:51:31 -05:00
Tom Alexander
8fd37cbf22 Remove a previously completed TODO. 2025-02-01 23:28:09 -05:00
Tom Alexander
4fb67c18ae Add support for rendering the images. 2025-02-01 23:14:20 -05:00
Tom Alexander
eb18185131 Add support for Image targets in the intermediate step.
Some checks are pending
clippy Build clippy has started
format Build format has succeeded
rust-test Build rust-test has succeeded
2025-02-01 21:45:52 -05:00
Tom Alexander
7c92b602bc Add automated test for testing the link target code.
Some checks failed
clippy Build clippy has failed
rust-test Build rust-test has succeeded
format Build format has succeeded
2025-02-01 17:59:08 -05:00
Tom Alexander
aeca958cef Add back in docker targets.
All checks were successful
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
format Build format has succeeded
2024-10-20 23:11:32 -04:00
Tom Alexander
495a3c0b4e Use linked copy. 2024-10-20 23:04:45 -04:00
Tom Alexander
9402c453da Add dockerfile syntax header. 2024-10-20 22:31:47 -04:00
Tom Alexander
328b2ba520 Merge branch 'buildkit'
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
2024-10-20 21:56:23 -04:00
Tom Alexander
4a76f61aa7 Update dockerfiles to take advantage of BuildKit.
All checks were successful
clippy Build clippy has succeeded
format Build format has succeeded
rust-test Build rust-test has succeeded
2024-10-20 21:50:16 -04:00
Tom Alexander
2c9396615e Switch to using BuiltKit instead of Kaniko to build docker images. 2024-10-20 21:47:11 -04:00
Tom Alexander
e7b6dc9059 Use the latest kaniko.
All checks were successful
rust-test Build rust-test has succeeded
format Build format has succeeded
clippy Build clippy has succeeded
build Build build has succeeded
2024-10-19 18:53:57 -04:00
Tom Alexander
bcdf441d77 Merge branch 'recursive_blog_post_directory'
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
2024-10-19 17:34:17 -04:00
Tom Alexander
884a28e63a Remove pointless copying.
All checks were successful
format Build format has succeeded
rust-test Build rust-test has succeeded
clippy Build clippy has succeeded
2024-10-19 17:28:50 -04:00
Tom Alexander
1c3e2ca4d9 Remove the last use of walkdir. 2024-10-19 17:26:37 -04:00
Tom Alexander
2081d25066 Remove a use of WalkDir. 2024-10-19 17:14:05 -04:00
Tom Alexander
7ddc4011b3 Use a type alias for read file results. 2024-10-19 17:03:52 -04:00
Tom Alexander
379850fe3d Use the deep path as the post id. 2024-10-19 16:55:38 -04:00
Tom Alexander
8ab69e480e Case insensitive match for org file extension. 2024-10-19 16:38:29 -04:00
Tom Alexander
c5621212bc Using multi-level deep folders successfully but the output is still shallow. 2024-10-19 16:35:45 -04:00
Tom Alexander
b9f74b7eca Write the filter to find the highest folders containing org documents. 2024-10-19 16:25:54 -04:00
Tom Alexander
493adb4688 Switch to iterative instead of recursive. 2024-10-19 16:15:23 -04:00
Tom Alexander
b6cc7a70b7 Future is not send. 2024-10-18 21:29:15 -04:00
Tom Alexander
8868cfb63f Don't need to hard-code static lifetime. 2024-10-18 21:23:22 -04:00
Tom Alexander
ae3add9c81 Fixed recursion using a BoxFuture. 2024-10-18 21:22:39 -04:00
Tom Alexander
98fa43575d Require boxing?. 2024-10-18 21:19:40 -04:00
Tom Alexander
5d3a6c4174 Also infinite. 2024-10-18 21:15:23 -04:00
Tom Alexander
be467c8074 infinite recursion? 2024-10-18 21:13:50 -04:00
Tom Alexander
0da375c529 Add a function to recursively list all entries in a directory with tokio. 2024-10-18 21:05:29 -04:00
Tom Alexander
1b740b1f2f Update dependencies.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
2024-10-18 20:33:41 -04:00
Tom Alexander
d94ecefab9 Merge branch 'webhook_bridge'
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
2024-09-30 17:39:04 -04:00
Tom Alexander
7501a018fd Switch to using webhook_bridge instead of lighthouse for triggering the CI. 2024-09-30 17:38:10 -04:00
Tom Alexander
ce31397372 Inline the build natter pipeline.
All checks were successful
format Build format has succeeded
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded
build-natter Build build-natter has succeeded
2024-04-12 18:59:34 -04:00
Tom Alexander
7e1e070e23 Update organic.
All checks were successful
format Build format has succeeded
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded
2024-04-12 18:48:25 -04:00
Tom Alexander
fa16a7dd39 Add styling for pagination links.
All checks were successful
rust-test Build rust-test has succeeded
format Build format has succeeded
build-natter Build build-natter has succeeded
rust-clippy Build rust-clippy has succeeded
2023-12-23 23:09:24 -05:00
Tom Alexander
59a91331cc Add support for target links.
All checks were successful
format Build format has succeeded
build-natter Build build-natter has succeeded
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded
2023-12-23 22:54:48 -05:00
Tom Alexander
d2ea6b6a0f Add a light mode to the site.
All checks were successful
format Build format has succeeded
build-natter Build build-natter has succeeded
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded
2023-12-23 21:54:16 -05:00
Tom Alexander
fdff5a667b Merge branch 'post_links'
All checks were successful
format Build format has succeeded
build-natter Build build-natter has succeeded
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded
2023-12-23 21:40:37 -05:00
Tom Alexander
35cf675c87 Fix clippy.
All checks were successful
format Build format has succeeded
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded
2023-12-23 21:36:24 -05:00
Tom Alexander
3b63bbdfde Add support for subpaths. 2023-12-23 21:29:59 -05:00
Tom Alexander
24218f2979 Generate post links, so far only top-level. 2023-12-23 21:22:43 -05:00
Tom Alexander
6a086d57de Generate Post link when the protocol is post. 2023-12-23 20:55:32 -05:00
Tom Alexander
93e0a2fe98 Add URL parsing. 2023-12-23 20:45:20 -05:00
Tom Alexander
86d4e25aa0 Add support for a target variable in regular links.
This will initially be used for supporting "post://" links.
2023-12-23 20:35:27 -05:00
Tom Alexander
cb5d131097 Add support for plain links.
All checks were successful
format Build format has succeeded
rust-test Build rust-test has succeeded
rust-clippy Build rust-clippy has succeeded
build-natter Build build-natter has succeeded
2023-12-23 19:23:39 -05:00
Tom Alexander
eb67327574 Do not error if posts directory does not exist.
All checks were successful
build-natter Build build-natter has succeeded
format Build format has succeeded
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded
2023-12-23 17:14:31 -05:00
Tom Alexander
5228851c0e Merge branch 'pages'
All checks were successful
rust-test Build rust-test has succeeded
rust-clippy Build rust-clippy has succeeded
format Build format has succeeded
build-natter Build build-natter has succeeded
2023-12-23 17:00:24 -05:00
Tom Alexander
4fc08f4375 Add a template for static pages.
All checks were successful
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded
format Build format has succeeded
2023-12-23 16:55:49 -05:00
Tom Alexander
8905c9356b Add a build for regular non-blog-post pages from org source. 2023-12-23 16:55:49 -05:00
Tom Alexander
424a970014 Add make target to run tests, clippy, and the auto-formatter locally.
All checks were successful
format Build format has succeeded
build-natter Build build-natter has succeeded
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded
2023-12-23 16:02:24 -05:00
Tom Alexander
138d694b27 Copy static files over to the output directory. 2023-12-23 15:45:23 -05:00
Tom Alexander
397d4ea0bc Fix clippy issues.
All checks were successful
rust-test Build rust-test has succeeded
rust-clippy Build rust-clippy has succeeded
build-natter Build build-natter has succeeded
format Build format has succeeded
2023-12-23 07:08:06 -05:00
Tom Alexander
818fca87f2 Merge branch 'ci_test'
Some checks failed
rust-test Build rust-test has succeeded
rust-clippy Build rust-clippy has failed
format Build format has succeeded
build-natter Build build-natter has succeeded
2023-12-23 06:14:47 -05:00
fluxcdbot
df339f20fa CI: autofix rust code.
Some checks failed
rust-clippy Build rust-clippy has failed
rust-test Build rust-test has succeeded
format Build format has succeeded
2023-12-23 01:46:40 +00:00
Tom Alexander
d5572c93cd Add prettier step.
Some checks failed
rust-clippy Build rust-clippy has failed
format Build format has succeeded
rust-test Build rust-test has succeeded
2023-12-22 20:43:39 -05:00
Tom Alexander
322dbb8f4f Add CI job to auto-format code. 2023-12-22 20:37:47 -05:00
Tom Alexander
904f834c86 Add CI job to run clippy.
Some checks failed
rust-clippy Build rust-clippy has failed
rust-test Build rust-test has succeeded
2023-12-22 20:08:24 -05:00
Tom Alexander
48af194da0 Use a resolver to remove dependency on installed catalog tasks.
All checks were successful
rust-test Build rust-test has succeeded
2023-12-22 20:02:16 -05:00
Tom Alexander
bcb6b2d75f Inline the cargo cache autoclean step. 2023-12-22 20:02:16 -05:00
Tom Alexander
134444b2c3 Set cargo target dir.
This is to avoid writing to the target dir in the repo folder.
2023-12-22 19:45:46 -05:00
Tom Alexander
4447f1ed4a Inline the test pipeline. 2023-12-22 19:31:12 -05:00
Tom Alexander
457ff9e759 Add dockerfile for running rust tests.
All checks were successful
rust-test Build rust-test has succeeded
2023-12-22 19:09:34 -05:00
Tom Alexander
6f244a0a5f Add pipeline for running the rust tests. 2023-12-22 19:09:34 -05:00
Tom Alexander
cb5838345e Merge branch 'style_tables'
All checks were successful
build-natter Build build-natter has succeeded
2023-12-22 18:07:46 -05:00
Tom Alexander
1107a653cf Add borders to the table groups. 2023-12-22 18:06:55 -05:00
Tom Alexander
95d4ee7080 Render the table groups. 2023-12-22 18:06:55 -05:00
Tom Alexander
fa2dd96f78 Update intermediate phase for table groups. 2023-12-22 18:00:07 -05:00
Tom Alexander
7741e192f5 Group table rows into sections. 2023-12-22 00:08:06 -05:00
Tom Alexander
5dfd46852f Add some basic styling to tables. 2023-12-21 21:59:52 -05:00
Tom Alexander
88e10010d8 Remove extra workspace from tekton pipeline.
Some checks failed
build-natter Build build-natter has failed
2023-12-21 20:36:03 -05:00
Tom Alexander
52c564d4fd Merge branch 'docker' 2023-12-21 20:29:00 -05:00
Tom Alexander
f7874c1843 Add lighthouse job to build the natter images. 2023-12-21 20:25:46 -05:00
Tom Alexander
40120667f7 Add a Dockerfile for building and running natter. 2023-12-21 20:04:04 -05:00
Tom Alexander
b06798f23f Prepare for publishing to crates.io. 2023-12-21 19:40:28 -05:00
Tom Alexander
35dff5cdaf Rename to natter. 2023-12-21 19:28:31 -05:00
Tom Alexander
d641c8d638 Merge branch 'pretty' 2023-12-21 18:36:23 -05:00
Tom Alexander
7e2fd70212 Style the homepage. 2023-12-21 18:34:42 -05:00
Tom Alexander
4fb08bc7d0 Wrap inline footnote definitions in a paragraph tag.
This is to match the behavior of the upstream org html exporter.
2023-12-21 18:09:43 -05:00
Tom Alexander
01b55b7256 Make paragraphs under footnote definitions display inline.
This seems to be the behavior of the upstream org html exporter.
2023-12-21 17:44:40 -05:00
Tom Alexander
bd68681e44 Increase the size of headlines.
This is to make them stand out more from the regular text.
2023-12-21 17:31:19 -05:00
Tom Alexander
27ff13e675 Also special-case plain list items containing only paragraphs and sublists.
This seems to be the behavior of the upstream org html exporter.
2023-12-21 17:27:19 -05:00
Tom Alexander
2914e42ba1 For plain list items with a single child that is a paragraph, do not wrap in paragraph html tags.
This is mimicking the behavior from org-mode's HTML exporter.
2023-12-21 17:18:51 -05:00
Tom Alexander
a8969f141d Style code and verbatim. 2023-12-21 16:49:44 -05:00
Tom Alexander
6f049e00d4 Style inline source blocks. 2023-12-21 16:42:22 -05:00
Tom Alexander
45a1076d18 Style descriptive plain lists. 2023-12-21 16:39:26 -05:00
Tom Alexander
775c88d67a Style footnotes. 2023-12-21 15:44:56 -05:00
Tom Alexander
efbf6cfc0c Style ordered and unordered plain lists. 2023-12-21 15:31:13 -05:00
Tom Alexander
5af4a372ae Make object trailing space dependent on post_blank. 2023-12-21 15:13:07 -05:00
Tom Alexander
72952adb6b Add post_blank to the rust types. 2023-12-21 15:09:13 -05:00
Tom Alexander
8b85c02ef1 Wrap the intermediate Registry in an IntermediateContext.
This is currently just to maintain consistency with the render phase's RenderContext but in the future it should allow us to include immutable data that is not locked behind the ArcMutex.
2023-12-21 13:53:56 -05:00
Tom Alexander
2ae4839ce0 Remove common whitespace prefix from src block lines. 2023-12-21 13:16:05 -05:00
Tom Alexander
5654c40d03 Get the real language for src blocks from the org source. 2023-12-21 12:07:36 -05:00
Tom Alexander
b538750287 Preserve whitespace in src blocks. 2023-12-21 12:04:29 -05:00
Tom Alexander
65ed754bfe Space out some elements. 2023-12-19 21:57:33 -05:00
Tom Alexander
80cdf5166b Style quote blocks, h2, and h3. 2023-12-19 21:41:41 -05:00
Tom Alexander
3968121d54 Style src blocks. 2023-12-19 21:30:59 -05:00
Tom Alexander
a29b625631 Apply a dark background. 2023-12-19 20:33:21 -05:00
Tom Alexander
e193fcc2ba Start applying styles to blog posts. 2023-12-19 19:23:56 -05:00
Tom Alexander
050b426f6f Merge branch 'homepage' 2023-12-19 18:08:50 -05:00
Tom Alexander
da81f93e4a Re-enable the CSS reset sheet. 2023-12-19 18:06:52 -05:00
Tom Alexander
1581e5c401 Rename the output root directory in the render context. 2023-12-19 18:03:59 -05:00
Tom Alexander
2e1c979127 Add a prefix to footnote IDs.
This avoids a conflict with multiple blog posts rendering in the same stream.
2023-12-19 18:01:54 -05:00
Tom Alexander
d4b290ebe6 Remove unnecessary let statements from render macro. 2023-12-19 17:31:50 -05:00
Tom Alexander
4bb1f9983a Standardize the construction of intermediate BlogPostPage. 2023-12-19 17:31:16 -05:00
Tom Alexander
261fe8a1a2 Fix the links to the blog posts. 2023-12-19 16:49:46 -05:00
Tom Alexander
add267d616 Switch over to using the render context in render calls. 2023-12-19 16:20:12 -05:00
Tom Alexander
cb3278aba5 Create a struct that will combine all the context for converting intermediate objects into the dust render context. 2023-12-19 14:54:12 -05:00
Tom Alexander
94d9a95967 Add a basic template for the blog stream page. 2023-12-19 14:13:29 -05:00
Tom Alexander
6511115b95 Implement a flawed version of RenderBlogStreamEntry::new.
There are some shortcomings in this implementation listed in the comments, but this is the general structure.
2023-12-19 10:59:34 -05:00
Tom Alexander
53cd55932b Implement RenderBlogStream::new.
I still need to implement RenderBlogStreamEntry::new.
2023-12-19 10:47:03 -05:00
Tom Alexander
cbe2010407 Invoke dust to render the stream pages.
At this point the render_blog_stream function is done, but RenderBlogStream::new needs to be implemented to actually generate the render context. The body of this function should be similar to convert_blog_post_page_to_render_context.
2023-12-17 17:26:15 -05:00
Tom Alexander
2ba4a5e3d7 Generate newer and older links. 2023-12-17 17:16:26 -05:00
Tom Alexander
c3482cf1e4 Chunking the blog posts for the stream. 2023-12-17 16:57:37 -05:00
Tom Alexander
fdf84e3d0b Finding the index page. 2023-12-17 15:45:50 -05:00
Tom Alexander
0a4376dfb8 Rename intermediate blog post source file. 2023-12-17 15:32:07 -05:00
Tom Alexander
e8ed4a4f4a Initial structure for rendering a blog post stream. 2023-12-17 15:32:07 -05:00
Tom Alexander
60555999db TEMP: Disable the css reset.
This is so I can develop the header without having any CSS written yet since the page is a mess without CSS.
2023-12-17 14:56:23 -05:00
Tom Alexander
6968a5b02c Merge branch 'header' 2023-12-17 14:47:45 -05:00
Tom Alexander
c84cfdc02b Basic template for a page header. 2023-12-17 14:45:42 -05:00
Tom Alexander
c98489cacb Add the page header to the render context. 2023-12-17 14:45:42 -05:00
Tom Alexander
35dbab0ceb Create a page header struct. 2023-12-17 14:45:42 -05:00
Tom Alexander
1ff41940a5 Merge branch 'css' 2023-12-17 14:02:20 -05:00
Tom Alexander
884215a7e1 Writing the stylesheets to the output folder. 2023-12-17 13:46:47 -05:00
Tom Alexander
20c55f0708 Loading stylesheets from the default environment. 2023-12-17 12:43:47 -05:00
Tom Alexander
9e3d72972c Add a CSS reset file. 2023-12-17 11:55:38 -05:00
Tom Alexander
806c45a453 Switch back to the published version of organic. 2023-12-17 11:54:59 -05:00
Tom Alexander
270c42a509 Update to use get_value from the latest organic code. 2023-10-31 22:03:22 -04:00
Tom Alexander
e8963e107b Merge branch 'table' 2023-10-31 20:38:36 -04:00
Tom Alexander
0b64551a23 Add templates for tables. 2023-10-31 20:31:36 -04:00
Tom Alexander
b654ca4859 Add render phase to tables. 2023-10-31 20:29:37 -04:00
Tom Alexander
386af57ce6 Add intermediate stage for tables. 2023-10-31 20:26:34 -04:00
Tom Alexander
ef4d315bf2 Run cargo fix. 2023-10-31 20:02:46 -04:00
Tom Alexander
2142b01967 Merge branch 'text_markup' 2023-10-31 20:02:13 -04:00
Tom Alexander
159d8fb72a Add render stage for text markup. 2023-10-31 20:02:04 -04:00
Tom Alexander
0fae417610 Add intermediate stage for text markup. 2023-10-31 19:57:04 -04:00
Tom Alexander
ae933b491e Use macros for the intermediate to render step.
This is largely to make changing the type signature of these functions easier by significantly reducing the amount of places that duplicates the signature.
2023-10-31 19:48:05 -04:00
Tom Alexander
5e476e189a Merge branch 'latex_fragment' 2023-10-31 19:18:20 -04:00
Tom Alexander
533997dbf5 Add a template for latex fragment. 2023-10-31 19:16:13 -04:00
Tom Alexander
8695cf17c5 Copy the value of latex fragments through the pipeline. 2023-10-31 19:14:36 -04:00
Tom Alexander
e2f9938437 Add notes about latex fragments.
The places they are currently occurring in my posts are unintentional, so I don't think I will be implementing latex fragments right now, but the notes are worth keeping.
2023-10-31 12:32:20 -04:00
Tom Alexander
ada11816fb Run cargo fix. 2023-10-29 22:31:29 -04:00
Tom Alexander
ff57242434 Merge branch 'footnote' 2023-10-29 22:29:38 -04:00
Tom Alexander
0da37b25e3 Assign the reference counts. 2023-10-29 22:29:29 -04:00
Tom Alexander
ff03140007 Order the footnotes based on when they start processing rather than when they finish.
This has the benefit of making the output order make sense when footnote definitions reference footnote references but I mostly did it to match the behavior of upstream org-mode.
2023-10-29 22:29:29 -04:00
Tom Alexander
0ae492f8d3 Promote waiting footnote definitions. 2023-10-29 22:29:29 -04:00
Tom Alexander
613d49c6ec Record on-deck footnote definitions. 2023-10-29 22:29:29 -04:00
Tom Alexander
0f7e5eea25 no-op the template for footnote definitions. 2023-10-29 22:29:29 -04:00
Tom Alexander
2e7cfd5637 Only parse footnote definitions if they target a reference that exists. 2023-10-29 22:29:28 -04:00
Tom Alexander
afe62de2b6 Re-enable AstNode. 2023-10-29 22:29:28 -04:00
Tom Alexander
1f3b5262b8 Fix build by making the registry guarded by an ArcMutex. 2023-10-29 22:29:28 -04:00
Tom Alexander
f63620b547 Registry being mutuably borrowed. 2023-10-29 22:29:28 -04:00
Tom Alexander
671159cb82 Does not work even without IntoAstNode. 2023-10-29 22:29:28 -04:00
Tom Alexander
f1e985fb32 Lifetime issue. 2023-10-29 22:29:28 -04:00
Tom Alexander
a966be8122 Remove closures from iselector macro. 2023-10-29 22:29:28 -04:00
Tom Alexander
24b9782146 Avoid closures for the intermediate macro. 2023-10-29 22:29:28 -04:00
Tom Alexander
3d44d20384 Running into borrow issue on intermediate. 2023-10-29 18:46:14 -04:00
Tom Alexander
f98a09bc59 Use macros for creating the intermediate stage.
This is to make it easier to change function signatures by consolidating the places where the signatures exist.
2023-10-29 18:46:14 -04:00
Tom Alexander
ba511b7f9e Add another test for footnote definitions. 2023-10-29 18:46:13 -04:00
Tom Alexander
3720558d93 Render the footnote definitions. 2023-10-29 18:46:13 -04:00
Tom Alexander
b66ec507ef Create a render ast node type. 2023-10-29 18:46:13 -04:00
Tom Alexander
645ae26701 Remove intermediate lifetime. 2023-10-29 14:53:11 -04:00
Tom Alexander
6109902945 Create an intermediate ast node type. 2023-10-29 14:45:02 -04:00
Tom Alexander
cd27869122 Populate render context for footnote references. 2023-10-29 14:45:02 -04:00
Tom Alexander
795945f0da Register footnote definitions. 2023-10-29 14:45:02 -04:00
Tom Alexander
cb7c28c1ae Add intermediate lifetime. 2023-10-29 12:24:49 -04:00
Tom Alexander
52ca300de3 Beginning to hand out footnote ids. 2023-10-29 12:24:49 -04:00
Tom Alexander
06dcd22e69 Switch to split inclusive instead of manually-implemented full lines iterator. 2023-10-29 10:59:33 -04:00
Tom Alexander
f87c453459 Move the full lines iterator to its own file. 2023-10-29 10:55:03 -04:00
Tom Alexander
e42edb3f49 Merge branch 'src_block' 2023-10-29 10:44:42 -04:00
Tom Alexander
6d83828012 Add inline source block. 2023-10-29 10:44:32 -04:00
Tom Alexander
eaea37f448 Add a basic template for source blocks. 2023-10-29 10:41:03 -04:00
Tom Alexander
fb99fd2b39 Get the source code lines. 2023-10-29 10:32:05 -04:00
Tom Alexander
313313ae53 Initial structure for unhighlighted source blocks. 2023-10-29 09:37:27 -04:00
Tom Alexander
d9a3b13780 Use raw_link instead of path for regular links. 2023-10-29 09:31:00 -04:00
Tom Alexander
8d9a50226a Add a tree-sitter-highlight dependency for source blocks. 2023-10-27 21:17:00 -04:00
Tom Alexander
f164838953 Add a space after objects. 2023-10-27 20:54:24 -04:00
Tom Alexander
fe3f2642fe Add a marker to make incomplete templates more obvious in the rendered html. 2023-10-27 20:51:27 -04:00
Tom Alexander
3d89492518 Add regular link. 2023-10-27 20:43:57 -04:00
Tom Alexander
793789bdf2 Add entity. 2023-10-27 20:27:50 -04:00
Tom Alexander
dbea9318e9 Merge branch 'plain_list' 2023-10-27 20:21:30 -04:00
Tom Alexander
4adaeb0341 Add line break. 2023-10-27 20:21:21 -04:00
Tom Alexander
bfc9e3ed80 Add plain list items. 2023-10-27 20:18:19 -04:00
Tom Alexander
62ffc76376 Add basic templates for plain list. 2023-10-27 20:12:56 -04:00
Tom Alexander
5bbb12327b Add template for quote blocks. 2023-10-27 19:53:18 -04:00
Tom Alexander
f6c475c80c Add templates for text markup. 2023-10-27 19:42:33 -04:00
Tom Alexander
4c3bea06d1 Add templates for target, keyword, comment block and comment. 2023-10-27 19:30:16 -04:00
Tom Alexander
0e9d74b2c8 Merge branch 'element_template' 2023-10-27 19:26:38 -04:00
Tom Alexander
6bf1480366 Add a template for paragraph. 2023-10-27 19:26:27 -04:00
Tom Alexander
c279bad13a Add children to heading. 2023-10-27 19:22:17 -04:00
Tom Alexander
bd982fb62d Add a template for section. 2023-10-27 18:30:29 -04:00
Tom Alexander
53a531f568 Add dispatcher for object and element. 2023-10-27 18:26:56 -04:00
Tom Alexander
67b60087af Add templates for the ast nodes. 2023-10-27 18:15:53 -04:00
Tom Alexander
8a3b85d5fa Merge branch 'element_noop' 2023-10-27 17:49:04 -04:00
Tom Alexander
b0ac14ee58 Add the skeletons for the objects. 2023-10-27 17:48:19 -04:00
Tom Alexander
23713a934c Add the skeletons for the elements. 2023-10-27 17:08:58 -04:00
Tom Alexander
860b601f62 Merge branch 'build_site' 2023-10-27 16:19:39 -04:00
Tom Alexander
354d24cf69 Add comment as a no-op. 2023-10-27 16:14:37 -04:00
Tom Alexander
5891ac7fb7 Add keyword and as no-op. 2023-10-27 16:09:44 -04:00
Tom Alexander
f9377d7609 Make converstion to intermediate state async.
We are going to need to do things like call external tools for syntax highlighting so we are going to need async in there eventually.
2023-10-27 15:55:19 -04:00
Tom Alexander
4a6948cde7 Add paragraph. 2023-10-27 15:46:56 -04:00
Tom Alexander
5b34942b64 Add element. 2023-10-27 15:46:56 -04:00
255 changed files with 10674 additions and 679 deletions

3
.dockerignore Normal file
View File

@@ -0,0 +1,3 @@
**/.git
target/
org_test_documents/

View File

@@ -0,0 +1,224 @@
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: build
spec:
timeouts:
pipeline: "2h0m0s"
tasks: "1h0m0s"
finally: "0h30m0s"
taskRunTemplate:
serviceAccountName: build-bot
pipelineSpec:
params:
- name: image-name
description: The name for the built image
type: string
- name: target-name
description: The dockerfile target to build
type: string
- name: path-to-image-context
description: The path to the build context
type: string
- name: path-to-dockerfile
description: The path to the Dockerfile
type: string
tasks:
- name: report-pending
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has started"
- name: STATE
value: pending
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: fetch-repository
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/git-clone/0.9/git-clone.yaml
workspaces:
- name: output
workspace: git-source
params:
- name: url
value: $(params.REPO_URL)
- name: revision
value: $(params.PULL_BASE_SHA)
- name: deleteExisting
value: "true"
- name: get-git-commit-time
taskSpec:
metadata: {}
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: "$(workspaces.repo.path)"
results:
- name: unix-time
description: The time of the git commit in unix timestamp format.
steps:
- image: alpine/git:v2.34.2
name: detect-tag-step
script: |
#!/usr/bin/env sh
set -euo pipefail
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
workspaces:
- name: repo
workspace: git-source
runAfter:
- fetch-repository
- name: build-image
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision
value: 7ee31a185243ee6da13dcd26a592c585b64c80e5
- name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params:
- name: OUTPUT
value: >-
type=image,"name=$(params.image-name):latest,$(params.image-name):$(tasks.fetch-repository.results.commit)",push=true,compression=zstd,compression-level=22,oci-mediatypes=true
- name: CONTEXT
value: $(params.path-to-image-context)
- name: DOCKERFILE
value: $(params.path-to-dockerfile)
- name: EXTRA_ARGS
value:
- "--opt"
- "target=$(params.target-name)"
- --import-cache
- "type=registry,ref=$(params.image-name):buildcache"
- --export-cache
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --opt
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- name: BUILDKITD_TOML
value: |
debug = true
[registry."docker.io"]
mirrors = ["dockerhub.dockerhub.svc.cluster.local"]
[registry."dockerhub.dockerhub.svc.cluster.local"]
http = true
insecure = true
workspaces:
- name: source
workspace: git-source
- name: dockerconfig
workspace: docker-credentials
runAfter:
- fetch-repository
finally:
- name: report-success
when:
- input: "$(tasks.status)"
operator: in
values: ["Succeeded", "Completed"]
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has succeeded"
- name: STATE
value: success
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: report-failure
when:
- input: "$(tasks.status)"
operator: in
values: ["Failed"]
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has failed"
- name: STATE
value: failure
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
workspaces:
- name: git-source
- name: docker-credentials
workspaces:
- name: git-source
volumeClaimTemplate:
spec:
storageClassName: "local-path"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
subPath: rust-source
- name: docker-credentials
secret:
secretName: harbor-plain
params:
- name: image-name
value: "harbor.fizz.buzz/private/natter"
- name: target-name
value: ""
- name: path-to-image-context
value: .
- name: path-to-dockerfile
value: docker/natter/

View File

@@ -0,0 +1,369 @@
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: rust-format
spec:
timeouts:
pipeline: "2h0m0s"
tasks: "1h0m0s"
finally: "0h30m0s"
taskRunTemplate:
serviceAccountName: build-bot
pipelineSpec:
params:
- name: image-name
description: The name for the built image
type: string
- name: target-name
description: The dockerfile target to build
type: string
- name: path-to-image-context
description: The path to the build context
type: string
- name: path-to-dockerfile
description: The path to the Dockerfile
type: string
tasks:
- name: report-pending
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has started"
- name: STATE
value: pending
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: fetch-repository
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/git-clone/0.9/git-clone.yaml
workspaces:
- name: output
workspace: git-source
params:
- name: url
value: $(params.REPO_URL)
- name: revision
value: $(params.PULL_BASE_SHA)
- name: deleteExisting
value: "true"
- name: get-git-commit-time
taskSpec:
metadata: {}
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: "$(workspaces.repo.path)"
results:
- name: unix-time
description: The time of the git commit in unix timestamp format.
steps:
- image: alpine/git:v2.34.2
name: detect-tag-step
script: |
#!/usr/bin/env sh
set -euo pipefail
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
workspaces:
- name: repo
workspace: git-source
runAfter:
- fetch-repository
- name: build-image
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision
value: 7ee31a185243ee6da13dcd26a592c585b64c80e5
- name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params:
- name: OUTPUT
value: >-
type=image,"name=$(params.image-name):latest,$(params.image-name):$(tasks.fetch-repository.results.commit)",push=true,compression=zstd,compression-level=22,oci-mediatypes=true
- name: CONTEXT
value: $(params.path-to-image-context)
- name: DOCKERFILE
value: $(params.path-to-dockerfile)
- name: EXTRA_ARGS
value:
- "--opt"
- "target=$(params.target-name)"
- --import-cache
- "type=registry,ref=$(params.image-name):buildcache"
- --export-cache
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --opt
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- name: BUILDKITD_TOML
value: |
debug = true
[registry."docker.io"]
mirrors = ["dockerhub.dockerhub.svc.cluster.local"]
[registry."dockerhub.dockerhub.svc.cluster.local"]
http = true
insecure = true
workspaces:
- name: source
workspace: git-source
- name: dockerconfig
workspace: docker-credentials
runAfter:
- fetch-repository
- name: run-cargo-fmt
taskSpec:
metadata: {}
params:
- name: docker-image
type: string
description: Docker image to run.
default: alpine:3.20
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: /workspace/source
workspaces:
- name: source
mountPath: /source
- name: cargo-cache
mountPath: /usr/local/cargo/registry
optional: true
steps:
- name: run
image: $(params.docker-image)
workingDir: "$(workspaces.source.path)"
command: ["cargo", "fmt"]
args: []
env:
- name: CARGO_TARGET_DIR
value: /target
workspaces:
- name: source
workspace: git-source
- name: cargo-cache
workspace: cargo-cache
runAfter:
- build-image
params:
- name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])"
- name: run-prettier
taskSpec:
metadata: {}
params:
- name: docker-image
type: string
description: Docker image to run.
default: alpine:3.20
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: /workspace/source
workspaces:
- name: source
mountPath: /source
steps:
- name: run
image: $(params.docker-image)
workingDir: "$(workspaces.source.path)"
command: ["sh", "-c"]
args:
- |
prettier --write --no-error-on-unmatched-pattern "default_environment/**/*.js" "default_environment/**/*.css"
workspaces:
- name: source
workspace: git-source
runAfter:
- build-image
params:
- name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])"
- name: commit-changes
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/git-cli/0.4/git-cli.yaml
params:
- name: GIT_USER_NAME
value: fluxcdbot
- name: GIT_USER_EMAIL
value: "fluxcdbot@users.noreply.github.com"
- name: GIT_SCRIPT
value: |
pwd
git config --global --add safe.directory /workspace/source
git_status=$(git status --porcelain)
if [ -n "$git_status" ]; then
git commit -a -m "CI: autofix rust code."
git push origin HEAD:$(params.PULL_BASE_REF)
else
echo "No changes to commit."
fi
workspaces:
- name: source
workspace: git-source
runAfter:
- run-cargo-fmt
- run-prettier
finally:
- name: report-success
when:
- input: "$(tasks.status)"
operator: in
values: ["Succeeded", "Completed"]
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has succeeded"
- name: STATE
value: success
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: report-failure
when:
- input: "$(tasks.status)"
operator: in
values: ["Failed"]
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has failed"
- name: STATE
value: failure
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: cargo-cache-autoclean
taskSpec:
metadata: {}
params:
- name: docker-image
type: string
description: Docker image to run.
default: alpine:3.20
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: /workspace/source
workspaces:
- name: source
mountPath: /source
- name: cargo-cache
mountPath: /usr/local/cargo/registry
optional: true
steps:
- name: run
image: $(params.docker-image)
workingDir: "$(workspaces.source.path)"
command: [cargo, cache, --autoclean]
args: []
workspaces:
- name: source
workspace: git-source
- name: cargo-cache
workspace: cargo-cache
params:
- name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])"
workspaces:
- name: git-source
- name: docker-credentials
- name: cargo-cache
workspaces:
- name: git-source
volumeClaimTemplate:
spec:
storageClassName: "local-path"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
subPath: rust-source
- name: cargo-cache
persistentVolumeClaim:
claimName: natter-cargo-cache-fmt
- name: docker-credentials
secret:
secretName: harbor-plain
params:
- name: image-name
value: "harbor.fizz.buzz/private/natter-development-format"
- name: target-name
value: ""
- name: path-to-image-context
value: docker/natter_development/
- name: path-to-dockerfile
value: docker/natter_development/

View File

@@ -0,0 +1,313 @@
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: rust-clippy
spec:
taskRunTemplate:
serviceAccountName: build-bot
timeouts:
pipeline: "2h0m0s"
tasks: "1h0m40s"
finally: "0h30m0s"
pipelineSpec:
params:
- name: image-name
description: The name for the built image
type: string
- name: target-name
description: The dockerfile target to build
type: string
- name: path-to-image-context
description: The path to the build context
type: string
- name: path-to-dockerfile
description: The path to the Dockerfile
type: string
tasks:
- name: report-pending
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has started"
- name: STATE
value: pending
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: fetch-repository
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/git-clone/0.9/git-clone.yaml
workspaces:
- name: output
workspace: git-source
params:
- name: url
value: $(params.REPO_URL)
- name: revision
value: $(params.PULL_BASE_SHA)
- name: deleteExisting
value: "true"
- name: get-git-commit-time
taskSpec:
metadata: {}
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: "$(workspaces.repo.path)"
results:
- name: unix-time
description: The time of the git commit in unix timestamp format.
steps:
- image: alpine/git:v2.34.2
name: detect-tag-step
script: |
#!/usr/bin/env sh
set -euo pipefail
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
workspaces:
- name: repo
workspace: git-source
runAfter:
- fetch-repository
- name: build-image
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision
value: 7ee31a185243ee6da13dcd26a592c585b64c80e5
- name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params:
- name: OUTPUT
value: >-
type=image,"name=$(params.image-name):latest,$(params.image-name):$(tasks.fetch-repository.results.commit)",push=true,compression=zstd,compression-level=22,oci-mediatypes=true
- name: CONTEXT
value: $(params.path-to-image-context)
- name: DOCKERFILE
value: $(params.path-to-dockerfile)
- name: EXTRA_ARGS
value:
- "--opt"
- "target=$(params.target-name)"
- --import-cache
- "type=registry,ref=$(params.image-name):buildcache"
- --export-cache
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --opt
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- name: BUILDKITD_TOML
value: |
debug = true
[registry."docker.io"]
mirrors = ["dockerhub.dockerhub.svc.cluster.local"]
[registry."dockerhub.dockerhub.svc.cluster.local"]
http = true
insecure = true
workspaces:
- name: source
workspace: git-source
- name: dockerconfig
workspace: docker-credentials
runAfter:
- fetch-repository
- name: run-cargo-clippy
taskSpec:
metadata: {}
params:
- name: docker-image
type: string
description: Docker image to run.
default: alpine:3.20
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: /workspace/source
workspaces:
- name: source
mountPath: /source
- name: cargo-cache
mountPath: /usr/local/cargo/registry
optional: true
steps:
- name: run
image: $(params.docker-image)
workingDir: "$(workspaces.source.path)"
command:
[
"cargo",
"clippy",
"--no-deps",
"--all-targets",
"--all-features",
"--",
"-D",
"warnings",
]
args: []
env:
- name: CARGO_TARGET_DIR
value: /target
workspaces:
- name: source
workspace: git-source
- name: cargo-cache
workspace: cargo-cache
runAfter:
- build-image
params:
- name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])"
finally:
- name: report-success
when:
- input: "$(tasks.status)"
operator: in
values: ["Succeeded", "Completed"]
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has succeeded"
- name: STATE
value: success
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: report-failure
when:
- input: "$(tasks.status)"
operator: in
values: ["Failed"]
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has failed"
- name: STATE
value: failure
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: cargo-cache-autoclean
taskSpec:
metadata: {}
params:
- name: docker-image
type: string
description: Docker image to run.
default: alpine:3.20
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: /workspace/source
workspaces:
- name: source
mountPath: /source
- name: cargo-cache
mountPath: /usr/local/cargo/registry
optional: true
steps:
- name: run
image: $(params.docker-image)
workingDir: "$(workspaces.source.path)"
command: [cargo, cache, --autoclean]
args: []
workspaces:
- name: source
workspace: git-source
- name: cargo-cache
workspace: cargo-cache
params:
- name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])"
workspaces:
- name: git-source
- name: docker-credentials
- name: cargo-cache
workspaces:
- name: git-source
volumeClaimTemplate:
spec:
storageClassName: "local-path"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
subPath: rust-source
- name: cargo-cache
persistentVolumeClaim:
claimName: natter-cargo-cache-clippy
- name: docker-credentials
secret:
secretName: harbor-plain
params:
- name: image-name
value: "harbor.fizz.buzz/private/natter-development-clippy"
- name: target-name
value: ""
- name: path-to-image-context
value: docker/natter_development/
- name: path-to-dockerfile
value: docker/natter_development/

View File

@@ -0,0 +1,303 @@
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: rust-test
spec:
timeouts:
pipeline: "2h0m0s"
tasks: "1h0m40s"
finally: "0h30m0s"
taskRunTemplate:
serviceAccountName: build-bot
pipelineSpec:
params:
- name: image-name
description: The name for the built image
type: string
- name: target-name
description: The dockerfile target to build
type: string
- name: path-to-image-context
description: The path to the build context
type: string
- name: path-to-dockerfile
description: The path to the Dockerfile
type: string
tasks:
- name: report-pending
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has started"
- name: STATE
value: pending
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: fetch-repository
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/git-clone/0.9/git-clone.yaml
workspaces:
- name: output
workspace: git-source
params:
- name: url
value: $(params.REPO_URL)
- name: revision
value: $(params.PULL_BASE_SHA)
- name: deleteExisting
value: "true"
- name: get-git-commit-time
taskSpec:
metadata: {}
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: "$(workspaces.repo.path)"
results:
- name: unix-time
description: The time of the git commit in unix timestamp format.
steps:
- image: alpine/git:v2.34.2
name: detect-tag-step
script: |
#!/usr/bin/env sh
set -euo pipefail
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
workspaces:
- name: repo
workspace: git-source
runAfter:
- fetch-repository
- name: build-image
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision
value: 7ee31a185243ee6da13dcd26a592c585b64c80e5
- name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params:
- name: OUTPUT
value: >-
type=image,"name=$(params.image-name):latest,$(params.image-name):$(tasks.fetch-repository.results.commit)",push=true,compression=zstd,compression-level=22,oci-mediatypes=true
- name: CONTEXT
value: $(params.path-to-image-context)
- name: DOCKERFILE
value: $(params.path-to-dockerfile)
- name: EXTRA_ARGS
value:
- "--opt"
- "target=$(params.target-name)"
- --import-cache
- "type=registry,ref=$(params.image-name):buildcache"
- --export-cache
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --opt
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- name: BUILDKITD_TOML
value: |
debug = true
[registry."docker.io"]
mirrors = ["dockerhub.dockerhub.svc.cluster.local"]
[registry."dockerhub.dockerhub.svc.cluster.local"]
http = true
insecure = true
workspaces:
- name: source
workspace: git-source
- name: dockerconfig
workspace: docker-credentials
runAfter:
- fetch-repository
- name: run-cargo-test
taskSpec:
metadata: {}
params:
- name: docker-image
type: string
description: Docker image to run.
default: alpine:3.20
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: /workspace/source
workspaces:
- name: source
mountPath: /source
- name: cargo-cache
mountPath: /usr/local/cargo/registry
optional: true
steps:
- name: run
image: $(params.docker-image)
workingDir: "$(workspaces.source.path)"
command: [cargo, test, --no-fail-fast]
args: []
env:
- name: CARGO_TARGET_DIR
value: /target
workspaces:
- name: source
workspace: git-source
- name: cargo-cache
workspace: cargo-cache
runAfter:
- build-image
params:
- name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])"
finally:
- name: report-success
when:
- input: "$(tasks.status)"
operator: in
values: ["Succeeded", "Completed"]
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has succeeded"
- name: STATE
value: success
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: report-failure
when:
- input: "$(tasks.status)"
operator: in
values: ["Failed"]
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has failed"
- name: STATE
value: failure
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: cargo-cache-autoclean
taskSpec:
metadata: {}
params:
- name: docker-image
type: string
description: Docker image to run.
default: alpine:3.20
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: /workspace/source
workspaces:
- name: source
mountPath: /source
- name: cargo-cache
mountPath: /usr/local/cargo/registry
optional: true
steps:
- name: run
image: $(params.docker-image)
workingDir: "$(workspaces.source.path)"
command: [cargo, cache, --autoclean]
args: []
workspaces:
- name: source
workspace: git-source
- name: cargo-cache
workspace: cargo-cache
params:
- name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])"
workspaces:
- name: git-source
- name: docker-credentials
- name: cargo-cache
workspaces:
- name: git-source
volumeClaimTemplate:
spec:
storageClassName: "local-path"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
subPath: rust-source
- name: cargo-cache
persistentVolumeClaim:
claimName: natter-cargo-cache-test
- name: docker-credentials
secret:
secretName: harbor-plain
params:
- name: image-name
value: "harbor.fizz.buzz/private/natter-development-test"
- name: target-name
value: ""
- name: path-to-image-context
value: docker/natter_development/
- name: path-to-dockerfile
value: docker/natter_development/

View File

@@ -0,0 +1,25 @@
version = "0.0.1"
[[push]]
name = "rust-test"
source = "pipeline-rust-test.yaml"
clone_uri = "git@code.fizz.buzz:talexander/natter.git"
skip_branches = [ "^v[0-9]+\\.[0-9]+\\.[0-9]+$" ]
[[push]]
name = "clippy"
source = "pipeline-rust-clippy.yaml"
clone_uri = "git@code.fizz.buzz:talexander/natter.git"
skip_branches = [ "^v[0-9]+\\.[0-9]+\\.[0-9]+$" ]
[[push]]
name = "format"
source = "pipeline-format.yaml"
clone_uri = "git@code.fizz.buzz:talexander/natter.git"
skip_branches = [ "^v[0-9]+\\.[0-9]+\\.[0-9]+$" ]
[[push]]
name = "build"
source = "pipeline-build-hash.yaml"
clone_uri = "git@code.fizz.buzz:talexander/natter.git"
branches = [ "^main$", "^master$" ]

1562
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +1,54 @@
[package] [package]
name = "writer" name = "natter"
version = "0.0.1" version = "0.0.1"
edition = "2021" edition = "2024"
authors = ["Tom Alexander <tom@fizz.buzz>"]
description = "A static site generator using org source files."
license = "0BSD"
repository = "https://code.fizz.buzz/talexander/natter"
readme = "README.md"
keywords = ["static", "site", "generator"]
categories = ["command-line-utilities"]
resolver = "2"
include = [
"LICENSE",
"**/*.rs",
"Cargo.toml",
"Cargo.lock",
"default_environment/"
]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
clap = { version = "4.4.6", default-features = false, features = ["std", "color", "help", "derive"] } clap = { version = "4.4.6", default-features = false, features = ["std", "color", "help", "derive"] }
duster = { git = "https://code.fizz.buzz/talexander/duster.git", branch = "master" } duster = "0.1.1"
futures = "0.3.29"
include_dir = "0.7.3" include_dir = "0.7.3"
# TODO: This is temporary to work on the latest organic code. Eventually switch back to using the published crate. # TODO: This is temporary to work on the latest organic code. Eventually switch back to using the published crate.
organic = { path = "../organic" } # organic = { path = "../organic" }
# organic = "0.1.12" organic = "0.1.16"
serde = { version = "1.0.189", default-features = false, features = ["std", "derive"] } serde = { version = "1.0.189", default-features = false, features = ["std", "derive"] }
serde_json = "1.0.107" serde_json = "1.0.107"
tokio = { version = "1.30.0", default-features = false, features = ["rt", "rt-multi-thread", "fs", "io-util"] } tokio = { version = "1.30.0", default-features = false, features = ["rt", "rt-multi-thread", "fs", "io-util"] }
toml = "0.8.2" toml = "0.8.2"
walkdir = "2.4.0" tree-sitter-bash = "0.23.3"
tree-sitter-highlight = "0.25.2"
tree-sitter-nix = "0.0.2"
tree-sitter-python = "0.23.6"
url = "2.5.0"
tracing = { version = "0.1.37", optional = true }
tracing-opentelemetry = { version = "0.20.0", optional = true }
tracing-subscriber = { version = "0.3.17", optional = true, features = ["env-filter"] }
opentelemetry = { version = "0.20.0", optional = true, default-features = false, features = ["trace", "rt-tokio"] }
opentelemetry-otlp = { version = "0.13.0", optional = true }
opentelemetry-semantic-conventions = { version = "0.12.0", optional = true }
[features]
default = ["tracing"]
tracing = ["dep:opentelemetry", "dep:opentelemetry-otlp", "dep:opentelemetry-semantic-conventions", "dep:tracing", "dep:tracing-opentelemetry", "dep:tracing-subscriber"]
# Optimized build for any sort of release.
[profile.release-lto]
inherits = "release"
lto = true
strip = "symbols"

39
Makefile Normal file
View File

@@ -0,0 +1,39 @@
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
OS:=$(shell uname -s)
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >
IMAGE_NAME:=natter
TARGET :=
.PHONY: help
help:
> @grep -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -E 's/^([^:]*): *## */\1: /'
.PHONY: docker_test
docker_test: ## Run the rust tests
> $(MAKE) -C docker/natter_development build
> docker run --rm -i -t --mount type=tmpfs,destination=/tmp -v "$(shell readlink -f .):/source" --workdir=/source --env CARGO_TARGET_DIR=/target -v "natter-cargo-registry:/usr/local/cargo/registry" natter-development cargo test
.PHONY: docker_clippy
docker_clippy: ## Run static analysis of the code.
> $(MAKE) -C docker/natter_development build
> docker run --rm -i -t --mount type=tmpfs,destination=/tmp -v "$(shell readlink -f .):/source" --workdir=/source --env CARGO_TARGET_DIR=/target -v "natter-cargo-registry:/usr/local/cargo/registry" natter-development cargo clippy --no-deps --all-targets --all-features -- -D warnings
.PHONY: docker_format
docker_format: ## Auto-format source files.
> $(MAKE) -C docker/natter_development build
> docker run --rm -i -t --mount type=tmpfs,destination=/tmp -v "$(shell readlink -f .):/source" --workdir=/source --env CARGO_TARGET_DIR=/target -v "natter-cargo-registry:/usr/local/cargo/registry" natter-development cargo fmt
> docker run --rm -i -t --mount type=tmpfs,destination=/tmp -v "$(shell readlink -f .):/source" --workdir=/source --env CARGO_TARGET_DIR=/target -v "natter-cargo-registry:/usr/local/cargo/registry" natter-development prettier --write --no-error-on-unmatched-pattern "default_environment/**/*.js" "default_environment/**/*.css"
.PHONY: clean
clean:
> $(MAKE) -C docker/natter_development clean

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# Natter
Natter is a static site generator for blogs using org as an input format. It is at a very early stage, and will have deep sweeping changes.

21
TODO.org Normal file
View File

@@ -0,0 +1,21 @@
* Things to do [6/17]
** DONE If the paragraph only contains an image, text-align center
** DONE Syntax highlighting for code blocks
** TODO Render gnuplot
** TODO Pretty-print the timestamps
** TODO Support Table of Contents
** TODO Support line numbers in code blocks
** TODO Support references to code block lines
** TODO Only include text up to first heading on homepage and include a "read more" link
** DONE Make loading language-specific CSS files conditional on the presence of src blocks using those languages
** DONE Set up tracing so I can use warning and such
** TODO Make copying of language-specific CSS files conditional on the presence of src blocks using those languages
** TODO Switch to an entirely lazily-evaluated output tree
** TODO Add highlighting for languages [1/2]
*** DONE bash
*** TODO gnuplot
https://github.com/dpezto/tree-sitter-gnuplot is not on crates.io so I'd have to add a git dependency to use it. This would prevent publishing this crate to crates.io.
** DONE Bug: carry over highlight starts when breaking lines
** TODO Add dates to posts
** DONE Add support for unlisted posts (posts that do not show up on the homepage).
** TODO Add support for showing file name where we currently show language

View File

@@ -0,0 +1,39 @@
:root {
--srclg-bash-srchl-comment-color: #048a81;
--srclg-bash-srchl-function-color: #e95a62;
--srclg-bash-srchl-keyword-color: #1a936f;
--srclg-bash-srchl-property-color: inherit;
--srclg-bash-srchl-string-color: #ecc30b;
}
@media (prefers-color-scheme: light) {
:root {
--srclg-bash-srchl-comment-color: #fb757e;
--srclg-bash-srchl-function-color: #16a59d;
--srclg-bash-srchl-keyword-color: #e56c90;
--srclg-bash-srchl-property-color: inherit;
--srclg-bash-srchl-string-color: #133cf4;
}
}
.main_content {
.src_block {
&.srclg_bash {
.srchl_comment {
color: var(--srclg-bash-srchl-comment-color);
}
.srchl_function {
color: var(--srclg-bash-srchl-function-color);
}
.srchl_keyword {
color: var(--srclg-bash-srchl-keyword-color);
}
.srchl_property {
color: var(--srclg-bash-srchl-property-color);
}
.srchl_string {
color: var(--srclg-bash-srchl-string-color);
}
}
}
}

View File

@@ -0,0 +1,39 @@
:root {
--srclg-nix-srchl-keyword-color: #1a936f;
--srclg-nix-srchl-comment-color: #048a81;
--srclg-nix-srchl-property-color: #bfbccb;
--srclg-nix-srchl-string-color: #ecc30b;
--srclg-nix-srchl-string-special-path-color: #067bc2;
}
@media (prefers-color-scheme: light) {
:root {
--srclg-nix-srchl-keyword-color: #e56c90;
--srclg-nix-srchl-comment-color: #fb757e;
--srclg-nix-srchl-property-color: #404334;
--srclg-nix-srchl-string-color: #133cf4;
--srclg-nix-srchl-string-special-path-color: #f9843d;
}
}
.main_content {
.src_block {
&.srclg_nix {
.srchl_keyword {
color: var(--srclg-nix-srchl-keyword-color);
}
.srchl_comment {
color: var(--srclg-nix-srchl-comment-color);
}
.srchl_property {
color: var(--srclg-nix-srchl-property-color);
}
.srchl_string {
color: var(--srclg-nix-srchl-string-color);
}
.srchl_string_special_path {
color: var(--srclg-nix-srchl-string-special-path-color);
}
}
}
}

View File

@@ -0,0 +1,51 @@
/* ea912c */
/* e95a62 */
:root {
--srclg-python-srchl-comment-color: #048a81;
--srclg-python-srchl-function-builtin-color: #e95a62;
--srclg-python-srchl-keyword-color: #1a936f;
--srclg-python-srchl-property-color: inherit;
--srclg-python-srchl-string-color: #ecc30b;
--srclg-python-srchl-type-color: #067bc2;
--srclg-python-srchl-variable-color: #ea912c;
}
@media (prefers-color-scheme: light) {
:root {
--srclg-python-srchl-comment-color: #fb757e;
--srclg-python-srchl-function-builtin-color: #16a59d;
--srclg-python-srchl-keyword-color: #e56c90;
--srclg-python-srchl-property-color: inherit;
--srclg-python-srchl-string-color: #133cf4;
--srclg-python-srchl-type-color: #f9843d;
--srclg-python-srchl-variable-color: #156ed3;
}
}
.main_content {
.src_block {
&.srclg_python {
.srchl_comment {
color: var(--srclg-python-srchl-comment-color);
}
.srchl_function_builtin {
color: var(--srclg-python-srchl-function-builtin-color);
}
.srchl_keyword {
color: var(--srclg-python-srchl-keyword-color);
}
.srchl_property {
color: var(--srclg-python-srchl-property-color);
}
.srchl_string {
color: var(--srclg-python-srchl-string-color);
}
.srchl_type {
color: var(--srclg-python-srchl-type-color);
}
.srchl_variable {
color: var(--srclg-python-srchl-variable-color);
}
}
}
}

View File

@@ -0,0 +1,358 @@
:root {
--main-max-width: 800px;
--site-background-color: #0a0a0a;
--site-text-color: #fffffc;
--header-divider-color: #6a687a;
--stream-divider-color: #6ccff6;
--stream-post-background-color: #0a0a0a;
--blog-post-background-color: #0a0a0a;
--src-font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
Consolas, "DejaVu Sans Mono", monospace;
--src-block-background-color: #141414;
--src-block-border-color: #84828f;
--src-block-language-color: #0a0a0a;
--src-block-language-background: #84828f;
--quote-block-border-color: #84828f;
--table-border-color: #6a687a;
--table-odd-background-color: #0a0a0a;
--table-even-background-color: #141414;
--header-nav-regular-font-color: var(--site-text-color);
--header-nav-regular-background-color: var(--site-background-color);
--header-nav-hover-font-color: var(--site-background-color);
--header-nav-hover-background-color: var(--site-text-color);
--header-home-regular-font-color: var(--site-text-color);
--header-home-hover-font-color: #6ccff6;
}
@media (prefers-color-scheme: light) {
:root {
--site-background-color: #f5f5f5;
--site-text-color: #000003;
--header-divider-color: #959785;
--stream-divider-color: #933009;
--stream-post-background-color: #f5f5f5;
--blog-post-background-color: #f5f5f5;
--src-block-background-color: #ebebeb;
--src-block-border-color: #7b7d70;
--src-block-language-color: #f5f5f5;
--src-block-language-background: #7b7d70;
--quote-block-border-color: #7b7d70;
--table-border-color: #959785;
--table-odd-background-color: #f5f5f5;
--table-even-background-color: #ebebeb;
--header-nav-regular-font-color: var(--site-text-color);
--header-nav-regular-background-color: var(--site-background-color);
--header-nav-hover-font-color: var(--site-background-color);
--header-nav-hover-background-color: var(--site-text-color);
--header-home-regular-font-color: var(--site-text-color);
--header-home-hover-font-color: #933009;
}
}
* {
box-sizing: border-box;
}
body {
color: var(--site-text-color);
background-color: var(--site-background-color);
font-family: source-sans-pro, Seravek, "Gill Sans Nova", Ubuntu, Calibri,
"DejaVu Sans", sans-serif;
a:link,
a:visited {
/* TODO: Should I use a different color for links? */
color: var(--site-text-color);
}
}
.page_centering {
display: flex;
flex-direction: column;
align-items: center;
}
.page_header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: stretch;
width: 100%;
max-width: var(--main-max-width);
border-bottom: 0.1rem solid var(--header-divider-color);
.home_link {
display: block;
font-size: 2rem;
font-weight: 600;
text-decoration: none;
color: var(--header-home-regular-font-color);
transition-property: color;
transition-duration: 0.1s;
transition-timing-function: ease-out;
&:hover {
color: var(--header-home-hover-font-color) !important;
}
&:link,
&:visited {
color: inherit;
}
}
.header_nav_bar {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: end;
align-items: stretch;
column-gap: 1rem;
.nav_link {
display: flex;
flex-direction: column;
justify-content: space-around;
color: var(--header-nav-regular-font-color);
background: var(--header-nav-regular-background-color);
padding: 0 0.5rem;
transition-property: background, color;
transition-duration: 0.1s;
transition-timing-function: ease-out;
&:hover {
color: var(--header-nav-hover-font-color);
background: var(--header-nav-hover-background-color);
}
}
}
}
.main_content {
width: 100%;
max-width: var(--main-max-width);
font-size: 1.2rem;
line-height: 1.4;
padding-bottom: 8rem;
/* A stand-alone blog post (not in a blog stream). */
.blog_post {
padding: 1rem 0.2rem 0 0.2rem;
background: var(--blog-post-background-color);
}
.blog_stream {
.stream_divider {
color: var(--stream-divider-color);
margin: 40px 0;
}
.stream_nav {
display: flex;
flex-direction: row;
align-items: center;
> a {
display: inline-block;
padding: 0.2rem 0.5rem;
font-weight: 700;
font-size: 1.5rem;
}
> .spacer {
display: inline-block;
flex: 1 1;
}
}
}
/* A blog post in a blog stream (for example, the homepage). */
.blog_stream_post {
background: var(--stream-post-background-color);
padding: 0 0.2rem;
}
.blog_stream_post {
background: var(--stream-post-background-color);
}
.blog_stream_post:nth-child(1) {
padding-top: 1rem;
}
.blog_post_title {
font-size: 2.9rem;
font-weight: 700;
padding-bottom: 1rem;
}
p {
margin: 1rem 0;
&.image {
text-align: center;
}
}
.src_block {
background: var(--src-block-background-color);
border-radius: 3px;
border: 1px solid var(--src-block-border-color);
font-size: 1rem;
font-family: var(--src-font-family);
margin: 1rem 0;
font-variant-ligatures: none;
.src_language {
display: inline-block;
color: var(--src-block-language-color);
background: var(--src-block-language-background);
border-radius: 0 0 3px 0;
padding: 0.1rem 0.5rem;
font-size: 0.8rem;
vertical-align: top;
}
.src_body {
margin: 0.5rem;
.src_line {
white-space: pre-wrap;
overflow-wrap: anywhere;
}
}
}
.inline_source_block {
font-family: var(--src-font-family);
font-size: 1.2rem;
font-variant-ligatures: none;
}
.code,
.verbatim {
font-family: var(--src-font-family);
font-variant-ligatures: none;
}
.quote_block {
border-left: 1px solid var(--quote-block-border-color);
padding: 0 0 0 1rem;
margin: 1rem 0 1rem 2rem;
}
h2,
h3 {
margin: 1rem 0;
padding-bottom: 0.5rem;
}
h2 {
font-size: 2.3rem;
font-weight: 600;
}
h3 {
font-size: 2.1rem;
font-weight: 600;
}
.plain_list {
&.unordered {
list-style-type: disc;
padding-left: 2.5rem;
}
&.ordered {
list-style-type: decimal;
padding-left: 2.5rem;
}
&.descriptive {
font-size: 1rem;
> dt {
font-weight: 600;
}
> dd {
padding-left: 2.5rem;
}
}
}
.footnote_reference {
vertical-align: super;
font-size: 80%;
> a {
text-decoration: none;
}
}
.footnote_definition {
.label {
text-decoration: none;
}
.definition {
display: inline;
> p {
display: inline;
}
}
}
.org_table {
table-layout: fixed;
border-collapse: collapse;
border: 1px solid var(--table-border-color);
> tbody {
border-width: 1px 0;
border-style: solid;
border-color: var(--table-border-color);
> tr {
> td {
padding: 0.2rem;
}
}
> tr:nth-child(odd) {
background-color: var(--table-odd-background-color);
}
> tr:nth-child(even) {
background-color: var(--table-even-background-color);
}
}
> thead {
border-width: 1px 0;
border-style: solid;
border-color: var(--table-border-color);
> tr {
> th {
padding: 0.2rem;
font-weight: 600;
}
}
}
}
b {
font-weight: 700;
}
/* Never have media larger than its container */
img,
picture,
video {
max-width: 100%;
}
}

View File

@@ -0,0 +1,129 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: "";
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

View File

@@ -0,0 +1 @@
!!!!!!!! angle_link

View File

@@ -0,0 +1,58 @@
{@select key=.type}
{@eq value="heading"}{>heading/}{/eq}
{@eq value="section"}{>section/}{/eq}
{@eq value="paragraph"}{>paragraph/}{/eq}
{@eq value="plain_list"}{>plain_list/}{/eq}
{@eq value="center_block"}{>center_block/}{/eq}
{@eq value="quote_block"}{>quote_block/}{/eq}
{@eq value="special_block"}{>special_block/}{/eq}
{@eq value="dynamic_block"}{>dynamic_block/}{/eq}
{@eq value="footnote_definition"}{>footnote_definition/}{/eq}
{@eq value="comment"}{>comment/}{/eq}
{@eq value="drawer"}{>drawer/}{/eq}
{@eq value="property_drawer"}{>property_drawer/}{/eq}
{@eq value="table"}{>table/}{/eq}
{@eq value="verse_block"}{>verse_block/}{/eq}
{@eq value="comment_block"}{>comment_block/}{/eq}
{@eq value="example_block"}{>example_block/}{/eq}
{@eq value="export_block"}{>export_block/}{/eq}
{@eq value="src_block"}{>src_block/}{/eq}
{@eq value="clock"}{>clock/}{/eq}
{@eq value="diary_sexp"}{>diary_sexp/}{/eq}
{@eq value="planning"}{>planning/}{/eq}
{@eq value="fixed_width_area"}{>fixed_width_area/}{/eq}
{@eq value="horizontal_rule"}{>horizontal_rule/}{/eq}
{@eq value="keyword"}{>keyword/}{/eq}
{@eq value="babel_call"}{>babel_call/}{/eq}
{@eq value="latex_environment"}{>latex_environment/}{/eq}
{@eq value="bold"}{>bold/}{/eq}
{@eq value="italic"}{>italic/}{/eq}
{@eq value="underline"}{>underline/}{/eq}
{@eq value="strike_through"}{>strike_through/}{/eq}
{@eq value="code"}{>code/}{/eq}
{@eq value="verbatim"}{>verbatim/}{/eq}
{@eq value="plain_text"}{>plain_text/}{/eq}
{@eq value="regular_link_anchor"}{>regular_link_anchor/}{/eq}
{@eq value="regular_link_image"}{>regular_link_image/}{/eq}
{@eq value="radio_link"}{>radio_link/}{/eq}
{@eq value="radio_target"}{>radio_target/}{/eq}
{@eq value="plain_link"}{>plain_link/}{/eq}
{@eq value="angle_link"}{>angle_link/}{/eq}
{@eq value="org_macro"}{>org_macro/}{/eq}
{@eq value="entity"}{>entity/}{/eq}
{@eq value="latex_fragment"}{>latex_fragment/}{/eq}
{@eq value="export_snippet"}{>export_snippet/}{/eq}
{@eq value="footnote_reference"}{>footnote_reference/}{/eq}
{@eq value="citation"}{>citation/}{/eq}
{@eq value="citation_reference"}{>citation_reference/}{/eq}
{@eq value="inline_babel_call"}{>inline_babel_call/}{/eq}
{@eq value="inline_source_block"}{>inline_source_block/}{/eq}
{@eq value="line_break"}{>line_break/}{/eq}
{@eq value="target"}{>target/}{/eq}
{@eq value="statistics_cookie"}{>statistics_cookie/}{/eq}
{@eq value="subscript"}{>subscript/}{/eq}
{@eq value="superscript"}{>superscript/}{/eq}
{@eq value="timestamp"}{>timestamp/}{/eq}
{@none}{!TODO: make this panic!}ERROR: Unrecognized type {.type}.{/none}
{/select}
{! TODO: Maybe the final space should be conditional on end blank in the org source !}

View File

@@ -0,0 +1 @@
!!!!!!!! babel_call

View File

@@ -1,11 +1,19 @@
<div class="blog_post"> <article class="blog_post">
<div class="blog_post_intro"> {?.title}<h1 class="blog_post_title"><span>{.title}</span></h1>{/.title}
{?.title}{?.self_link}<a class="blog_post_title" href="{.link}">{.title}</a>{:else}<div class="blog_post_title">{.title}</div>{/.self_link}{/.title}
{! TODO: date? !} {! TODO: date? !}
</div>
{! TODO: Table of contents? !} {! TODO: Table of contents? !}
<div class="blog_post_body"> <div class="blog_post_body">
{#.children}
{>document_element/}
{/.children}
{?.footnotes}
<h2>Footnotes:</h2>
{#.footnotes}
{>real_footnote_definition/}
{/.footnotes}
{/.footnotes}
</div> </div>
</div> </article>

View File

@@ -0,0 +1,34 @@
<div class="blog_stream">
{#.children}
{@gt key=$idx value=0}<hr class="stream_divider" />{/gt}
<div class="blog_stream_post">
<div class="blog_post_intro">
{?.title}{?.self_link}<a class="blog_post_title" href="{.self_link}">{.title}</a>{:else}<div class="blog_post_title">{.title}</div>{/.self_link}{/.title}
{! TODO: date? !}
</div>
{! TODO: Table of contents? !}
<div class="blog_post_body">
{#.children}
{>document_element/}
{/.children}
{?.footnotes}
<h2>Footnotes:</h2>
{#.footnotes}
{>real_footnote_definition/}
{/.footnotes}
{/.footnotes}
</div>
</div>
{/.children}
{#.stream_pagination}
<hr class="stream_divider" />
<div class="stream_nav">
{?.older_link}<a href="{.older_link}">Older</a>{/.older_link}
<div class="spacer"></div>
{?.newer_link}<a href="{.newer_link}">Newer</a>{/.newer_link}
</div>
{/.stream_pagination}
</div>

View File

@@ -0,0 +1,3 @@
<b>{#.children}
{>object/}
{/.children}</b>

View File

@@ -0,0 +1 @@
!!!!!!!! center_block

View File

@@ -0,0 +1 @@
!!!!!!!! citation

View File

@@ -0,0 +1 @@
!!!!!!!! citation_reference

View File

@@ -0,0 +1 @@
!!!!!!!! clock

View File

@@ -0,0 +1 @@
<code class="code">{.contents}</code>

View File

@@ -0,0 +1 @@
{! noop !}

View File

@@ -0,0 +1 @@
{! noop !}

View File

@@ -0,0 +1 @@
!!!!!!!! diary_sexp

View File

@@ -0,0 +1,5 @@
{@select key=.type}
{@eq value="heading"}{>heading/}{/eq}
{@eq value="section"}{>section/}{/eq}
{@none}{!TODO: make this panic!}ERROR: Unrecognized type {.type}.{/none}
{/select}

View File

@@ -0,0 +1 @@
!!!!!!!! drawer

View File

@@ -0,0 +1 @@
!!!!!!!! dynamic_block

View File

@@ -0,0 +1,28 @@
{@select key=.type}
{@eq value="paragraph"}{>paragraph/}{/eq}
{@eq value="plain_list"}{>plain_list/}{/eq}
{@eq value="plain_list_simple_item"}{>plain_list_simple_item/}{/eq}
{@eq value="center_block"}{>center_block/}{/eq}
{@eq value="quote_block"}{>quote_block/}{/eq}
{@eq value="special_block"}{>special_block/}{/eq}
{@eq value="dynamic_block"}{>dynamic_block/}{/eq}
{@eq value="footnote_definition"}{>footnote_definition/}{/eq}
{@eq value="comment"}{>comment/}{/eq}
{@eq value="drawer"}{>drawer/}{/eq}
{@eq value="property_drawer"}{>property_drawer/}{/eq}
{@eq value="table"}{>table/}{/eq}
{@eq value="verse_block"}{>verse_block/}{/eq}
{@eq value="comment_block"}{>comment_block/}{/eq}
{@eq value="example_block"}{>example_block/}{/eq}
{@eq value="export_block"}{>export_block/}{/eq}
{@eq value="src_block"}{>src_block/}{/eq}
{@eq value="clock"}{>clock/}{/eq}
{@eq value="diary_sexp"}{>diary_sexp/}{/eq}
{@eq value="planning"}{>planning/}{/eq}
{@eq value="fixed_width_area"}{>fixed_width_area/}{/eq}
{@eq value="horizontal_rule"}{>horizontal_rule/}{/eq}
{@eq value="keyword"}{>keyword/}{/eq}
{@eq value="babel_call"}{>babel_call/}{/eq}
{@eq value="latex_environment"}{>latex_environment/}{/eq}
{@none}{!TODO: make this panic!}ERROR: Unrecognized type {.type}.{/none}
{/select}

View File

@@ -0,0 +1 @@
{.html|s}

View File

@@ -0,0 +1 @@
!!!!!!!! example_block

View File

@@ -0,0 +1 @@
!!!!!!!! export_block

View File

@@ -0,0 +1 @@
!!!!!!!! export_snippet

View File

@@ -0,0 +1 @@
!!!!!!!! fixed_width_area

View File

@@ -0,0 +1 @@
{! noop !}

View File

@@ -0,0 +1 @@
<sup class="footnote_reference"><a id="{.reference_id}" href="{.definition_link}">{.label}</a></sup>

View File

@@ -0,0 +1 @@
!!!!!!!! global_settings

View File

@@ -0,0 +1,11 @@
{@lte key=.level value=4}
<h{.level}>{#.title}{>object/}{/.title}</h{.level}>
{:else}
<ol>
<li>{#.title}{>object/}{/.title}</li>
</ol>
{/lte}
{#.children}
{>document_element/}
{/.children}

View File

@@ -0,0 +1 @@
!!!!!!!! horizontal_rule

View File

@@ -0,0 +1 @@
!!!!!!!! inline_babel_call

View File

@@ -0,0 +1 @@
<code class="inline_source_block">{.value}</code>

View File

@@ -0,0 +1,3 @@
<i>{#.children}
{>object/}
{/.children}</i>

View File

@@ -0,0 +1 @@
{! noop !}

View File

@@ -0,0 +1 @@
!!!!!!!! latex_environment

View File

@@ -0,0 +1,2 @@
{! TODO: Should I be including MathJax somewhere? !}
{.value}

View File

@@ -0,0 +1 @@
<br/>

View File

@@ -1,18 +1,21 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
{#global_settings.css_files}<link rel="stylesheet" href="{.}">{/global_settings.css_files} {#global_settings.css_files}<link rel="stylesheet" href="{.}">{/global_settings.css_files}
{#global_settings.js_files}<script type="text/javascript" src="{.}"></script>{/global_settings.js_files} {#global_settings.js_files}<script type="text/javascript" src="{.}"></script>{/global_settings.js_files}
{?global_settings.page_title}<title>{global_settings.page_title}</title>{/global_settings.page_title} {?global_settings.page_title}<title>{global_settings.page_title}</title>{/global_settings.page_title}
</head> </head>
<body> <body class="page_centering">
{! TODO: Header bar with links? !} {#.page_header}{>page_header/}{/.page_header}
<div class="main_content"> <main class="main_content">
{@select key=.type} {@select key=.type}
{@eq value="page"}{>page/}{/eq}
{@eq value="blog_post_page"}{>blog_post_page/}{/eq} {@eq value="blog_post_page"}{>blog_post_page/}{/eq}
{@eq value="blog_stream"}{>blog_stream/}{/eq}
{@none}{!TODO: make this panic!}ERROR: Unrecognized page content type{/none} {@none}{!TODO: make this panic!}ERROR: Unrecognized page content type{/none}
{/select} {/select}
</div> </main>
</body> </body>
</html> </html>

View File

@@ -0,0 +1,31 @@
{@select key=.type}
{@eq value="bold"}{>bold/}{/eq}
{@eq value="italic"}{>italic/}{/eq}
{@eq value="underline"}{>underline/}{/eq}
{@eq value="strike_through"}{>strike_through/}{/eq}
{@eq value="code"}{>code/}{/eq}
{@eq value="verbatim"}{>verbatim/}{/eq}
{@eq value="plain_text"}{>plain_text/}{/eq}
{@eq value="regular_link_anchor"}{>regular_link_anchor/}{/eq}
{@eq value="regular_link_image"}{>regular_link_image/}{/eq}
{@eq value="radio_link"}{>radio_link/}{/eq}
{@eq value="radio_target"}{>radio_target/}{/eq}
{@eq value="plain_link"}{>plain_link/}{/eq}
{@eq value="angle_link"}{>angle_link/}{/eq}
{@eq value="org_macro"}{>org_macro/}{/eq}
{@eq value="entity"}{>entity/}{/eq}
{@eq value="latex_fragment"}{>latex_fragment/}{/eq}
{@eq value="export_snippet"}{>export_snippet/}{/eq}
{@eq value="footnote_reference"}{>footnote_reference/}{/eq}
{@eq value="citation"}{>citation/}{/eq}
{@eq value="citation_reference"}{>citation_reference/}{/eq}
{@eq value="inline_babel_call"}{>inline_babel_call/}{/eq}
{@eq value="inline_source_block"}{>inline_source_block/}{/eq}
{@eq value="line_break"}{>line_break/}{/eq}
{@eq value="target"}{>target/}{/eq}
{@eq value="statistics_cookie"}{>statistics_cookie/}{/eq}
{@eq value="subscript"}{>subscript/}{/eq}
{@eq value="superscript"}{>superscript/}{/eq}
{@eq value="timestamp"}{>timestamp/}{/eq}
{@none}{!TODO: make this panic!}ERROR: Unrecognized type {.type}.{/none}
{/select}{@gt key=.post_blank value=0}{~s}{/gt}

View File

@@ -0,0 +1 @@
!!!!!!!! org_macro

View File

@@ -0,0 +1,19 @@
<article class="page">
{?.title}<h1 class="blog_post_title"><span>{.title}</span></h1>{/.title}
{! TODO: date? !}
{! TODO: Table of contents? !}
<div class="blog_post_body">
{#.children}
{>document_element/}
{/.children}
{?.footnotes}
<h2>Footnotes:</h2>
{#.footnotes}
{>real_footnote_definition/}
{/.footnotes}
{/.footnotes}
</div>
</article>

View File

@@ -0,0 +1,9 @@
<header class="page_header">
<a class="home_link" href="{.home_link}">{.website_title}</a>
{! TODO: Additional links? Probably using the nav semantic element. !}
<nav class="header_nav_bar">
{#.nav_links}
<a class="nav_link" href="{.url}"><div>{.text}</div></a>
{/.nav_links}
</nav>
</header>

View File

@@ -0,0 +1,3 @@
<p class="{?.is_single_image}image{/.is_single_image}">{#.children}
{>object/}
{/.children}</p>

View File

@@ -0,0 +1 @@
<a href="{.raw_link}">{.raw_link}</a>

View File

@@ -0,0 +1,6 @@
{@select key=.list_type}
{@eq value="unordered"}<ul class="plain_list unordered">{#.children}{>plain_list_item/}{/.children}</ul>{/eq}
{@eq value="ordered"}<ol class="plain_list ordered">{#.children}{>plain_list_item/}{/.children}</ol>{/eq}
{@eq value="descriptive"}<dl class="plain_list descriptive">{#.children}{>plain_list_item/}{/.children}</dl>{/eq}
{@none}{!TODO: make this panic!}ERROR: Unrecognized list type {.list_type}.{/none}
{/select}

View File

@@ -0,0 +1,6 @@
{@select key=list_type}
{@eq value="unordered"}<li>{#.children}{>element/}{/.children}</li>{/eq}
{@eq value="ordered"}<li>{#.children}{>element/}{/.children}</li>{/eq}
{@eq value="descriptive"}<dt>{#.tag}{>object/}{/.tag}</dt><dd>{#.children}{>element/}{/.children}</dd>{/eq}
{@none}{!TODO: make this panic!}ERROR: Unrecognized list type {.list_type}.{/none}
{/select}

View File

@@ -0,0 +1,3 @@
{#.children}
{>object/}
{/.children}

View File

@@ -0,0 +1 @@
{.source}

View File

@@ -0,0 +1 @@
!!!!!!!! planning

View File

@@ -0,0 +1 @@
!!!!!!!! property_drawer

View File

@@ -0,0 +1,3 @@
<blockquote class="quote_block">{#.children}
{>element/}
{/.children}</blockquote>

View File

@@ -0,0 +1 @@
!!!!!!!! radio_link

View File

@@ -0,0 +1 @@
!!!!!!!! radio_target

View File

@@ -0,0 +1 @@
<div class="footnote_definition"><a id="{.definition_id}" href="{.reference_link}" class="label">{.label}.</a> <div class="definition">{#.contents}{>ast_node/}{/.contents}</div></div>

View File

@@ -0,0 +1 @@
<a href="{.target}">{#.children}{>object/}{/.children}</a>

View File

@@ -0,0 +1 @@
<img src="{.src}" alt="{.alt}" />

View File

@@ -0,0 +1,3 @@
{#.children}
{>element/}
{/.children}

View File

@@ -0,0 +1 @@
!!!!!!!! special_block

View File

@@ -0,0 +1,17 @@
<div class="src_block{?.language} srclg_{.language}{/.language}">
{?.language}<div class="src_language">{.language}</div>{/.language}
<table class="src_body">
<tbody>
{#.lines}
<tr>
<td>{#.children}{@select key=.type}
{@eq value="raw_text"}<code class="src_line">{.content}</code>{/eq}
{@eq value="highlight_start"}<span class="srchl_{.name}">{/eq}
{@eq value="highlight_end"}</span>{/eq}
{@none}{!TODO: make this panic!}ERROR: Unrecognized type {.type}.{/none}
{/select}{/.children}</td>
</tr>
{/.lines}
</tbody>
</table>
</div>

View File

@@ -0,0 +1 @@
!!!!!!!! statistics_cookie

View File

@@ -0,0 +1,3 @@
<del>{#.children}
{>object/}
{/.children}</del>

View File

@@ -0,0 +1 @@
!!!!!!!! subscript

View File

@@ -0,0 +1 @@
!!!!!!!! superscript

View File

@@ -0,0 +1,5 @@
<table class="org_table">{#.children}{@select key=.type}
{@eq value="head"}{>table_head/}{/eq}
{@eq value="body"}{>table_body/}{/eq}
{@none}{!TODO: make this panic!}ERROR: Unrecognized type {.type}.{/none}
{/select}{/.children}</table>

View File

@@ -0,0 +1 @@
<tbody>{#.children}{>table_row/}{/.children}</tbody>

View File

@@ -0,0 +1 @@
<td>{#.children}{>object/}{/.children}</td>

View File

@@ -0,0 +1 @@
<thead>{#.children}{>table_head_row/}{/.children}</thead>

View File

@@ -0,0 +1 @@
<th scope="col">{#.children}{>object/}{/.children}</th>

View File

@@ -0,0 +1 @@
<tr>{#.children}{>table_head_cell/}{/.children}</tr>

View File

@@ -0,0 +1 @@
<tr>{#.children}{>table_cell/}{/.children}</tr>

View File

@@ -0,0 +1 @@
<a id="{.id}"></a>

View File

@@ -0,0 +1 @@
<span class="timestamp">{.source}</span>

View File

@@ -0,0 +1,3 @@
<u>{#.children}
{>object/}
{/.children}</u>

View File

@@ -0,0 +1 @@
<code class="verbatim">{.contents}</code>

View File

@@ -0,0 +1 @@
!!!!!!!! verse_block

16
docker/natter/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
# syntax=docker/dockerfile:1
ARG ALPINE_VERSION="3.20"
FROM rustlang/rust:nightly-alpine$ALPINE_VERSION AS builder
RUN apk add --no-cache musl-dev
RUN mkdir /root/natter
WORKDIR /root/natter
COPY --link . .
# TODO: Add static build, which currently errors due to proc_macro. RUSTFLAGS="-C target-feature=+crt-static"
RUN --mount=type=tmpfs,target=/tmp --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked CARGO_TARGET_DIR=/target cargo build --profile release-lto
FROM alpine:$ALPINE_VERSION AS runner
COPY --link --from=builder /target/release-lto/natter /usr/bin/

32
docker/natter/Makefile Normal file
View File

@@ -0,0 +1,32 @@
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
OS:=$(shell uname -s)
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >
IMAGE_NAME:=natter
TARGET :=
.PHONY: help
help:
> @grep -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -E 's/^([^:]*): *## */\1: /'
.PHONY: build
build: ## Build the docker image.
> docker build --tag $(IMAGE_NAME) --target=$(TARGET) --file Dockerfile ../../
.PHONY: shell
shell: ## Launch an interactive shell inside the docker image.
shell: build
> docker run --rm -i -t --entrypoint /bin/sh --mount type=tmpfs,destination=/tmp $(IMAGE_NAME)
.PHONY: clean
clean:
> docker rmi $(IMAGE_NAME)

View File

@@ -0,0 +1,14 @@
# syntax=docker/dockerfile:1
ARG ALPINE_VERSION="3.20"
FROM rustlang/rust:nightly-alpine$ALPINE_VERSION AS builder
RUN apk add --no-cache musl-dev
RUN --mount=type=tmpfs,target=/tmp --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked cargo install --locked --no-default-features --features ci-autoclean cargo-cache
RUN rustup component add rustfmt
RUN rustup component add clippy
FROM builder AS javascript
RUN apk add --no-cache npm
RUN --mount=type=tmpfs,target=/tmp --mount=type=cache,target=/npmcache,sharing=locked npm set cache /npmcache && npm install --global prettier@3.1.0

View File

@@ -0,0 +1,33 @@
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >
IMAGE_NAME:=natter-development
TARGET :=
.PHONY: help
help:
> @grep -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -E 's/^([^:]*): *## */\1: /'
.PHONY: build
build: ## Build the docker image.
> docker build --tag $(IMAGE_NAME) --target=$(TARGET) --file Dockerfile .
> docker volume create natter-cargo-registry
.PHONY: shell
shell: ## Launch an interactive shell inside the docker image with the source repository mounted at /source.
shell: build
> docker run --rm -i -t --entrypoint /bin/sh --mount type=tmpfs,destination=/tmp -v "$$(readlink -f ../../):/source" --workdir=/source --env CARGO_TARGET_DIR=/target -v "natter-cargo-registry:/usr/local/cargo/registry" $(IMAGE_NAME)
.PHONY: clean
clean:
> docker rmi $(IMAGE_NAME)
> docker volume rm natter-cargo-registry

View File

@@ -0,0 +1,21 @@
# This test shows that footnote references only count if the definition containing them is rendered.
foo[fn:a:bar]
[fn:a] lorem
[fn:b] ipsum
[fn:d] fizz
[fn:c] dolar
yo[fn:b]
hello[fn:c]
[fn:e] buzz
sup[fn:d]

View File

@@ -0,0 +1,25 @@
# Test proves that:
#
# - Anonymous references with identical content get unique IDs.
# - Unreferenced footnote definitions are dropped.
# - Footnote definitions that come before their first reference are dropped.
foo[fn:2:something]
bar[fn::something]
baz[fn::something]
cat[fn::something]
dog[fn:3]
[fn:3] ipsum
[fn:4] lorem
[fn:3] dolar
[fn:5] not referenced
stuff[fn:4] and things

View File

@@ -0,0 +1,36 @@
* Double dollar
#+begin_src org
$$CONTENTS$$
#+end_src
becomes
#+begin_src text
\[CONTENTS\]
#+end_src
#+begin_src org
$$1+1=2$$
#+end_src
#+begin_src text
\[1+1=2\]
#+end_src
This gets interpreted by mathjax.
* Single Dollar
#+begin_src org
PRE$BORDER1 BODY BORDER2$POST
#+end_src
becomes
#+begin_src text
\(BORDER1 BODY BORDER2\)
#+end_src
#+begin_src org
foo$a bar b$.
#+end_src
becomes
#+begin_src text
foo\(a bar b\).
#+end_src
This gets interpreted by mathjax.

View File

@@ -0,0 +1,22 @@
[[file:image.svg]]
[[file:/image.svg]]
[[file:./image.svg]]
[[/image.svg]]
[[./image.svg]]
# Check capitalization of extension
[[./image.SVG]]
# Check spaces in path
[[./image and stuff.SVG]]
[[/ssh:admin@test.example:important/file.svg]]
[[file:/ssh:admin@test.example:important/file.svg]]
# Check multiple parts in the path
[[file:/foo/bar/baz/image.svg]]

4
rust-toolchain.toml Normal file
View File

@@ -0,0 +1,4 @@
[toolchain]
channel = "nightly"
profile = "default"
components = ["clippy", "rustfmt"]

View File

@@ -4,7 +4,7 @@ use clap::Subcommand;
use std::path::PathBuf; use std::path::PathBuf;
#[derive(Parser, Debug)] #[derive(Parser, Debug)]
#[command(name = "Writer")] #[command(name = "Natter")]
#[command(version = env!("CARGO_PKG_VERSION"))] #[command(version = env!("CARGO_PKG_VERSION"))]
#[command(about = "Generate a static site.", long_about = None)] #[command(about = "Generate a static site.", long_about = None)]
#[command(propagate_version = true)] #[command(propagate_version = true)]
@@ -24,14 +24,14 @@ pub(crate) enum Commands {
#[derive(Args, Debug)] #[derive(Args, Debug)]
pub(crate) struct InitArgs { pub(crate) struct InitArgs {
/// Path where you want the initial writer structure to be located. /// Path where you want the initial natter structure to be located.
#[arg(short, long)] #[arg(short, long)]
pub(crate) path: PathBuf, pub(crate) path: PathBuf,
} }
#[derive(Args, Debug)] #[derive(Args, Debug)]
pub(crate) struct BuildArgs { pub(crate) struct BuildArgs {
/// Path to the writer config file. /// Path to the natter config file.
#[arg(short, long)] #[arg(short, long)]
pub(crate) config: PathBuf, pub(crate) config: PathBuf,
} }

View File

@@ -0,0 +1 @@

Some files were not shown because too many files have changed in this diff Show More