Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v7
with:
lfs: true
submodules: recursive

#https://github.com/actions/setup-dotnet/blob/main/README.md
- name: Setup .NET
uses: actions/setup-dotnet@v5
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
dotnet-quality: 'ga'
#dotnet-quality: 'preview'
dotnet-version: 11.0.x
#dotnet-quality: 'ga'
dotnet-quality: 'preview'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v7
with:
lfs: true
submodules: recursive
#https://github.com/actions/setup-dotnet/blob/main/README.md
- name: Setup .NET
uses: actions/setup-dotnet@v5
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
dotnet-quality: 'ga'
#dotnet-quality: 'preview'
dotnet-version: 11.0.x
#dotnet-quality: 'ga'
dotnet-quality: 'preview'

- name: get render dependencies
run: sh ./download-assets-pipeline.sh
Expand Down
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"ms-dotnettools.csdevkit",
"ms-dotnettools.csharp",
"yzhang.markdown-all-in-one"
]
}
61 changes: 61 additions & 0 deletions Assets/BundledAssets/Preview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{{Title}}</title>
<script type="text/javascript" src="{{Host}}prism.js"></script>
<style>
@import url(https://fonts.googleapis.com/css2?family=JetBrains+Mono&family=Nunito:wght@700&family=Open+Sans&display=swap);:root{--background:#f4f4f4;--foreground:#3e3e3e;--red:#970b16;--blue:#003e8a;--brightBlue:#2e6cba;--selection:#CACACA;--box-note:#0eb3d8;--box-tip:#24c27b;--box-important:#0eb3d8;--box-warning:#e1ae05;--box-caution:#b82e39;--box-foreground:#f4f4f4;--max-width:1200px}body.dark-mode{--background:#212121;--foreground:#f8f8f2;--red:#ff5555;--blue:#82aaff;--brightBlue:#d6acff;--selection:#5D5D5D;--box-note:#064f60;--box-tip:#105637;--box-important:#064f60;--box-warning:#644d02;--box-caution:#521419;--box-foreground:#f8f8f2}h1,h2,h3,h4,h5,h6{font-family:Nunito,sans-serif;font-optical-sizing:auto;font-weight:700;font-style:normal;line-height:1.3;margin-top:2rem;margin-bottom:1rem}body{font-family:"Open Sans",sans-serif;font-optical-sizing:auto;font-weight:400;font-style:normal;font-variation-settings:"wdth" 100;background-color:var(--background);color:var(--foreground);font-size:18px;line-height:1.75}main{max-width:var(--max-width);margin:0 auto;padding:2rem}a{color:var(--blue);text-decoration:underline}a:hover{color:var(--brightBlue);text-decoration:none}table{border-collapse:collapse;width:100%;table-layout:fixed}td,th{border:1px solid var(--foreground);text-align:left;padding:8px}tr:nth-child(even){background-color:var(--selection)}tr:hover{background-color:var(--brightBlue)}img{max-width:850px;margin:0 auto;display:block;padding:1em;transition:box-shadow .3s ease,transform .3s ease}img:hover{box-shadow:0 10px 20px rgba(0,0,0,.3);transform:translateY(-4px)}figure{margin:0;border:1px solid var(--selection);border-radius:5px}figcaption{text-align:center;font-style:italic}p code{color:var(--red);font-style:italic}pre{transition:box-shadow .3s ease,transform .3s ease;font-family:"JetBrains Mono",monospace;font-optical-sizing:auto;font-weight:400;font-style:normal;font-variant-ligatures:contextual;font-feature-settings:"liga","calt"}pre code{font-family:"JetBrains Mono",monospace;font-optical-sizing:auto;font-weight:400;font-style:normal;font-variant-ligatures:contextual;font-feature-settings:"liga","calt"}pre:hover{box-shadow:0 10px 20px rgba(0,0,0,.3);transform:translateY(-4px)}kbd{font-family:"JetBrains Mono",monospace;border-radius:.25rem;border:1px solid var(--foreground);box-shadow:0 2px 0 1px var(--selection);line-height:1;min-width:.75rem;text-align:center;padding:2px 5px}.float{position:fixed;top:10px;right:10px;width:52px}.icon{width:48px;fill:var(--foreground);display:block;margin:0 auto}.icon:hover{fill:var(--selection)}dialog{width:95%;height:95%;padding:.5rem;border:2px solid var(--selection);filter:drop-shadow(10px 10px 10px var(--foreground));background:var(--background);color:var(--foreground)}dialog #container{display:grid;height:100%;grid-template-rows:1fr auto;grid-template-columns:1fr;gap:8px 0}dialog #container #dialogContent{grid-column:1;grid-row:1}dialog #container #dialogBase{grid-column:1;grid-row:0}#toc{display:flex;gap:10px;flex-wrap:wrap}#toc section{max-width:250px}.pager{max-width:var(--max-width);margin:0 auto;display:flex;gap:16px}.pager a{display:inline-block;flex-grow:1;text-align:center;height:30px;padding:5px;background:var(--selection);color:var(--foreground);text-decoration:none}.pager a:hover{background:var(--brightBlue);color:var(--foreground)}.markdown-alert{padding:1rem;border-radius:.5rem;border:1px solid var(--foreground);margin-bottom:1rem}.markdown-alert .markdown-alert-title{font-weight:700}.markdown-alert-note{background-color:var(--box-note);color:var(--box-foreground)}.markdown-alert-note .markdown-alert-title::before{content:"📝";font-size:1.6rem}.markdown-alert-important{background-color:var(--box-important);color:var(--box-foreground)}.markdown-alert-important .markdown-alert-title::before{content:"🚩";font-size:1.6rem}.markdown-alert-tip{background-color:var(--box-tip);color:var(--box-foreground)}.markdown-alert-tip .markdown-alert-title::before{content:"💡";font-size:1.6rem}.markdown-alert-warning{background-color:var(--box-warning);color:var(--box-foreground)}.markdown-alert-warning .markdown-alert-title::before{content:"⚠️";font-size:1.6rem}.markdown-alert-caution{background-color:var(--box-caution);color:var(--box-foreground)}.markdown-alert-caution .markdown-alert-title::before{content:"❌";font-size:1.6rem}@media print{body{color:#000}figure,p,table,tr{break-inside:avoid}img{max-width:85%}.float{display:none!important}}code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}body.dark-mode code[class*=language-],body.dark-mode pre[class*=language-]{color:#f8f8f2;background:0 0;text-shadow:0 1px rgba(0,0,0,.3);font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}body.dark-mode pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}body.dark-mode :not(pre)>code[class*=language-],body.dark-mode pre[class*=language-]{background:#272822}body.dark-mode :not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}body.dark-mode .token.cdata,body.dark-mode .token.comment,body.dark-mode .token.doctype,body.dark-mode .token.prolog{color:#8292a2}body.dark-mode .token.punctuation{color:#f8f8f2}body.dark-mode .token.namespace{opacity:.7}body.dark-mode .token.constant,body.dark-mode .token.deleted,body.dark-mode .token.property,body.dark-mode .token.symbol,body.dark-mode .token.tag{color:#f92672}body.dark-mode .token.boolean,body.dark-mode .token.number{color:#ae81ff}body.dark-mode .token.attr-name,body.dark-mode .token.builtin,body.dark-mode .token.char,body.dark-mode .token.inserted,body.dark-mode .token.selector,body.dark-mode .token.string{color:#a6e22e}body.dark-mode .language-css .token.string,body.dark-mode .style .token.string,body.dark-mode .token.entity,body.dark-mode .token.operator,body.dark-mode .token.url,body.dark-mode .token.variable{color:#f8f8f2}body.dark-mode .token.atrule,body.dark-mode .token.attr-value,body.dark-mode .token.class-name,body.dark-mode .token.function{color:#e6db74}body.dark-mode .token.keyword{color:#66d9ef}body.dark-mode .token.important,body.dark-mode .token.regex{color:#fd971f}body.dark-mode .token.bold,body.dark-mode .token.important{font-weight:700}body.dark-mode .token.italic{font-style:italic}body.dark-mode .token.entity{cursor:help}
</style>
</head>

<body>
<dialog id="tocdialog" class="dialog">
<div id="container">
<div id="dialogContent">
<!-- The content of the dialog will be dynamically loaded here -->
</div>
<div id="dialogBase">
<button id="close" autofocus>❌ Close</button>
</div>
</div>
</dialog>

<main>
{{Content}}
</main>

<script type="text/javascript" src="{{Host}}pager.js"></script>

<aside class="float">
<a href="#" title="Toggle dark or light mode" onclick="darkModeToggle()">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path
d="M7.5,2C5.71,3.15 4.5,5.18 4.5,7.5C4.5,9.82 5.71,11.85 7.53,13C4.46,13 2,10.54 2,7.5A5.5,5.5 0 0,1 7.5,2M19.07,3.5L20.5,4.93L4.93,20.5L3.5,19.07L19.07,3.5M12.89,5.93L11.41,5L9.97,6L10.39,4.3L9,3.24L10.75,3.12L11.33,1.47L12,3.1L13.73,3.13L12.38,4.26L12.89,5.93M9.59,9.54L8.43,8.81L7.31,9.59L7.65,8.27L6.56,7.44L7.92,7.35L8.37,6.06L8.88,7.33L10.24,7.36L9.19,8.23L9.59,9.54M19,13.5A5.5,5.5 0 0,1 13.5,19C12.28,19 11.15,18.6 10.24,17.93L17.93,10.24C18.6,11.15 19,12.28 19,13.5M14.6,20.08L17.37,18.93L17.13,22.28L14.6,20.08M18.93,17.38L20.08,14.61L22.28,17.15L18.93,17.38M20.08,12.42L18.94,9.64L22.28,9.88L20.08,12.42M9.63,18.93L12.4,20.08L9.87,22.27L9.63,18.93Z" />
</svg>
</a>
<a href="#" title="Print this page" onclick="window.print()">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path
d="M19 8C20.66 8 22 9.34 22 11V17H18V21H6V17H2V11C2 9.34 3.34 8 5 8H6V3H18V8H19M8 5V8H16V5H8M16 19V15H8V19H16M18 15H20V11C20 10.45 19.55 10 19 10H5C4.45 10 4 10.45 4 11V15H6V13H18V15M19 11.5C19 12.05 18.55 12.5 18 12.5C17.45 12.5 17 12.05 17 11.5C17 10.95 17.45 10.5 18 10.5C18.55 10.5 19 10.95 19 11.5Z" />
</svg>
</a>
<a href="{{Host}}" title="Files...">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M3,9H17V7H3V9M3,13H17V11H3V13M3,17H17V15H3V17M19,17H21V15H19V17M19,7V9H21V7H19M19,13H21V11H19V13Z" />
</svg>
</a>
<a href="#" title="Scroll to the top" onclick="scrollUp()">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z" />
</svg>
</a>
</aside>
<script type="text/javascript">
function darkModeToggle(){document.body.classList.toggle("dark-mode")}function scrollUp(e=30){const o=()=>{const n=window.pageYOffset;n>0&&(window.scrollBy(0,-e),requestAnimationFrame(o))};requestAnimationFrame(o)}function openDialog(e){const o=document.getElementById(e),n=o.querySelector("#close");n.addEventListener("click",()=>{o.close()}),o.showModal()}
</script>
</body>
</html>
14 changes: 5 additions & 9 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@
<PackageVersion Include="Microsoft.ClearScript" Version="7.5.1" />
<PackageVersion Include="Microsoft.ClearScript.V8.Native.linux-x64" Version="7.5.1" />
<PackageVersion Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.5.1" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.10" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.3" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="11.0.0-preview.6.26359.118" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="11.0.0-preview.6.26359.118" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="11.0.0-preview.6.26359.118" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="4.0.0-preview" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="NUnit" Version="4.6.1" />
Expand All @@ -33,7 +29,7 @@
<PackageVersion Include="Spectre.Console" Version="0.57.2" />
<PackageVersion Include="Spectre.Console.Analyzer" Version="1.0.0" />
<PackageVersion Include="Svg.Skia" Version="5.1.1" />
<PackageVersion Include="System.ServiceModel.Syndication" Version="10.0.10" />
<PackageVersion Include="System.ServiceModel.Syndication" Version="11.0.0-preview.6.26359.118" />
<PackageVersion Include="Webmaster442.WindowsTerminal" Version="4.1.1" />
<PackageVersion Include="WeCantSpell.Hunspell" Version="7.0.1" />
<PackageVersion Include="XmlDocMarkdown.Core" Version="2.9.0" />
Expand Down
1 change: 1 addition & 0 deletions Docs/bookgen.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12164
7 changes: 7 additions & 0 deletions Docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ tags: ''
* Breaking: Removed edit command
* Breaking: Removed terminalinstall command, now part of install command
* Breaking: Removed Vstasks command and reworked it into a vscode command
* New: Based on .NET 11
* New: New logo by Mariann Kobzi
* New: Build system can be extended with custom build plugins
* New: VSCode command that can generate VSCode tasks.json file for the current project and recomend extensions
* New: Mermaid diagram rendering supported via mmdr
* New: Nomnoml diagram rendering supported via nomnoml
* New: PlantUML diagram rendering supported. Note: Requires seperate PlantUMl download and installation
* New: convert diagram2svg command to convert nomnoml and mermaid diagrams to SVG format
* New: Search command to search text in bookgen project contents
* New: Support for openCli specification
* New: Mixcloud media embeding supported
* New: Html2OpenXml command to convert HTML to OpenXML format for Word processing
* New: Template engine reworked, now supports functions and is more robust
* New: Preview command to preview the current project files in a browser
* New: table-csv syntax highlighting, that renders the data as a table in HTML output
* New: table-tsv syntax highlighting, that renders the data as a table in HTML output
* New: table-ssv syntax highlighting, that renders the data as a table in HTML output
* Change: Commands documentation generated from code and is now more complete
* Change: App settings reworked
* Change: Dropped mathjax as dependency for formula rendering. New formula rendering is based on katex and works with markdown syntax
Expand Down
3 changes: 3 additions & 0 deletions Docs/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ Markdown files are the main input format for BookGen. BookGen supports the follo
* YAML front matter for metadata
* Table of contents via the `[toc]` or `[toc maxlevel=n]` tag, where n is the level of headdings to include
* Keyboard input via the `<<` and `>>` tags, which will render the text between them as keyboard input.
* Comma separated values tables via the `table-csv` language identifier for source code. It only works for comma separated values.
* Tab separated values tables via the `table-tsv` language identifier for source code. It only works for tab separated values.
* Semicolon separated values tables via the `table-ssv` language identifier for source code. It only works for semicolon separated values.

### YAML Front matter

Expand Down
2 changes: 1 addition & 1 deletion Source/BookGen.Api/V1/RenderTags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ public sealed class RenderTags
/// <summary>
/// Additional data that can be used in the rendering process.
/// </summary>
public Dictionary<string, string> AdditionalData { get; set; } = new();
public Dictionary<string, string> AdditionalData { get; set; } = [];
}
4 changes: 1 addition & 3 deletions Source/BookGen.Cli/BookGen.Cli.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputPath>..\..\bin\$(Configuration)\</OutputPath>
Expand All @@ -10,8 +10,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Roslynator.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
17 changes: 1 addition & 16 deletions Source/BookGen.Cli/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
{
"version": 2,
"dependencies": {
"net10.0": {
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Direct",
"requested": "[10.0.10, )",
"resolved": "10.0.10",
"contentHash": "z/2xXlFw2aLGjHyEm6E0tQ+In6VfzQzTrtArbQ2c0TQE16ZbyDCMGPvaUT9I0s8rgy9sRWlU2P9waW37qV04qA=="
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Direct",
"requested": "[10.0.10, )",
"resolved": "10.0.10",
"contentHash": "zkFxGYUvdxAvIKTyXHrmW+Sux53D4SezD9dMyZ6hrwwzPQJNuwCRy1f5W7AvYTqacEGhWF2XderRQG1OvbV8og==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.10"
}
},
"net11.0": {
"Roslynator.Analyzers": {
"type": "Direct",
"requested": "[4.15.0, )",
Expand Down
2 changes: 1 addition & 1 deletion Source/BookGen.Contents/BookGen.Contents.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputPath>..\..\bin\$(Configuration)\</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion Source/BookGen.Lib/BookGen.Lib.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
Expand Down
Loading
Loading