Skip to content

Commit

Permalink
Merge pull request #378 from webmaster442/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
webmaster442 authored Nov 23, 2023
2 parents a2d7856 + 545f1be commit 4470ee1
Show file tree
Hide file tree
Showing 159 changed files with 2,548 additions and 1,348 deletions.
61 changes: 61 additions & 0 deletions .github/releases.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Releases · webmaster442/BookGen · GitHub</title>
<link>https://github.com/webmaster442/BookGen/releases</link>
<description>BookGen Updates RSS Feed</description>
<language>en</language>
<lastBuildDate>Mon, 9 Oct 2023 18:40:45 -0000</lastBuildDate>
<item>
<title>BookGen 2023.05.06</title>
<link>https://github.com/webmaster442/BookGen/releases/tag/2023-05-06</link>
<description>
🆕 New: GUI has been reworked. Instead of Terminal.GUI Spectre.Console is used
🆕 New: Pack subcommand to pack the book source into a zip file
🆕 New: Download command, to quickly download files from the internet to your project
🆕 New: Tasks command, which allows running additional tasks &amp; customizing workflow
🆕 New: Web server now has a dedicated page to make it easier to connect to it, from other devices
🆕 New: Linux build (experimental)
👁‍🗨 Change: The Shell's cdg command is now implemented as terminal UI program with more features
👁‍🗨 Change: Various fixes to support building and running on Linux distributions
👁‍🗨 Change: Default console log uses Spectre.Console for output. This produces more colourful output
👁‍🗨 Change: Reworked subcommand architecture
👁‍🗨 Change: Removed &amp; cleaned up NuGet package dependencies
👁‍🗨 Change: Test server port is now 8090
👁‍🗨 Change: Removed WP-Load program
👁‍🗨 Change: Removed Chapters command
👁‍🗨 Change: Removed InstallPS Autocomplete command
👁‍🗨 Change: Removed support for VS tasks
🔧 Fix: Various Web sever stability fixes &amp; improvements
🔧 Fix: E-pub build time has been reduced
🔧 Fix: Fixes a bug, which caused the progress bar messages while building not always readable
🔧 Fix: BookGen shell colour scheme adjusted in windows terminal for better readability
</description>
<pubDate>Sat, 6 May 2023 18:40:45 -0000</pubDate>
<guid isPermaLink="false">https://github.com/webmaster442/BookGen/releases/tag/2023-05-06</guid>
</item>
<item>
<title>BookGen 2023.01.12</title>
<link>https://github.com/webmaster442/BookGen/releases/tag/2023-01-12</link>
<description>
🆕 New: Rewrote launcher, looks a bit better &amp; has built in preview function
🆕 New: Math2SVG module (Requires internet connection to work)
🆕 New: Output type for post processing (experimental)
🆕 New: QR code generator module (Requires internet connection to work)
🆕 New: Print output produces an XHTML file too, with embedded CSS rules for better compatibility with word processing
🆕 New: JSON schema for config and tags available
🆕 New: Tags module can now auto extract tags with RAKE if needed
👁‍🗨 Change: Reworked preview module, now has a basic markdown editor
👁‍🗨 Change: BookGen now ships with .NET, no need to install it sepperately
👁‍🗨 Change: Updater now is a seperate program.
👁‍🗨 Change: Removed markdown editor from launcher
👁‍🗨 Change: Json output from now on doesn't encode non ASCII chars specially.
👁‍🗨 Change: Better XHTML output for e-Pub generation with the use of HTMLTidy
👁‍🗨 Change: Updated dependencies
👁‍🗨 Change: configuration files are moved into .bookgen folder for projects
</description>
<pubDate>Thu, 12 Jan 2023 18:25:45 -0000</pubDate>
<guid isPermaLink="false">https://github.com/webmaster442/BookGen/releases/tag/2023-01-12</guid>
</item>
</channel>
</rss>
8 changes: 8 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

#https://github.com/actions/setup-dotnet/blob/main/README.md
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-quality: 'ga'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: security-extended
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
#https://github.com/actions/setup-dotnet/blob/main/README.md
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
dotnet-quality: 'ga'
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
15 changes: 8 additions & 7 deletions BookGen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Items", "Items", "{287A3141
Scripts\publish-linux.sh = Scripts\publish-linux.sh
Scripts\publish-windows.ps1 = Scripts\publish-windows.ps1
README.md = README.md
.github\releases.xml = .github\releases.xml
.github\updates.json = .github\updates.json
EndProjectSection
EndProject
Expand Down Expand Up @@ -49,8 +50,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookGen.TestsSystem", "Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookGen.Launcher", "Prog\BookGen.Launcher\BookGen.Launcher.csproj", "{39416371-375D-4328-88C8-FCABF6043B25}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookGen.Update", "Prog\BookGen.Update\BookGen.Update.csproj", "{88ADE930-6480-4375-8BAE-40728258A28E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookGen.RakeEngine", "Libs\BookGen.RakeEngine\BookGen.RakeEngine.csproj", "{596AE4F8-A8C8-4B0E-8285-605E30498AFA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookGen.Contents", "Libs\BookGen.Contents\BookGen.Contents.csproj", "{8166DFAD-9B7A-4CCE-BE8B-577AC52D5066}"
Expand All @@ -61,6 +60,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cdg", "Prog\Cdg\Cdg.csproj"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookGen.Native", "Libs\BookGen.Native\BookGen.Native.csproj", "{8A1FEF90-2B8F-4849-B7C9-63EDE7F120E0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Www", "Prog\Www\Www.csproj", "{F9BB566F-AC41-4028-A00C-0200EC53E1D7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -119,10 +120,6 @@ Global
{39416371-375D-4328-88C8-FCABF6043B25}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39416371-375D-4328-88C8-FCABF6043B25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39416371-375D-4328-88C8-FCABF6043B25}.Release|Any CPU.Build.0 = Release|Any CPU
{88ADE930-6480-4375-8BAE-40728258A28E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88ADE930-6480-4375-8BAE-40728258A28E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88ADE930-6480-4375-8BAE-40728258A28E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88ADE930-6480-4375-8BAE-40728258A28E}.Release|Any CPU.Build.0 = Release|Any CPU
{596AE4F8-A8C8-4B0E-8285-605E30498AFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{596AE4F8-A8C8-4B0E-8285-605E30498AFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{596AE4F8-A8C8-4B0E-8285-605E30498AFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -143,6 +140,10 @@ Global
{8A1FEF90-2B8F-4849-B7C9-63EDE7F120E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A1FEF90-2B8F-4849-B7C9-63EDE7F120E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A1FEF90-2B8F-4849-B7C9-63EDE7F120E0}.Release|Any CPU.Build.0 = Release|Any CPU
{F9BB566F-AC41-4028-A00C-0200EC53E1D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9BB566F-AC41-4028-A00C-0200EC53E1D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9BB566F-AC41-4028-A00C-0200EC53E1D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9BB566F-AC41-4028-A00C-0200EC53E1D7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -161,12 +162,12 @@ Global
{DC8E84ED-6871-45D7-ADAF-5CBD87E50313} = {3A88EE87-A7B5-4AC4-AFB2-37EA4986A7BC}
{4322C426-E69D-4A8E-8852-DA9C6972860E} = {3A88EE87-A7B5-4AC4-AFB2-37EA4986A7BC}
{39416371-375D-4328-88C8-FCABF6043B25} = {05B69A0E-343B-4E7C-B77B-24E84B57D5D2}
{88ADE930-6480-4375-8BAE-40728258A28E} = {05B69A0E-343B-4E7C-B77B-24E84B57D5D2}
{596AE4F8-A8C8-4B0E-8285-605E30498AFA} = {9C47BBFF-ACD8-40D8-9FB1-A3FA524B27C4}
{8166DFAD-9B7A-4CCE-BE8B-577AC52D5066} = {9C47BBFF-ACD8-40D8-9FB1-A3FA524B27C4}
{859C300C-33B4-4F24-8A6C-F430520774DB} = {9C47BBFF-ACD8-40D8-9FB1-A3FA524B27C4}
{5F49A217-883B-499C-BEBD-22BC02E5EC8F} = {05B69A0E-343B-4E7C-B77B-24E84B57D5D2}
{8A1FEF90-2B8F-4849-B7C9-63EDE7F120E0} = {9C47BBFF-ACD8-40D8-9FB1-A3FA524B27C4}
{F9BB566F-AC41-4028-A00C-0200EC53E1D7} = {05B69A0E-343B-4E7C-B77B-24E84B57D5D2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {772515BA-79D4-4C5D-AF16-29DE649EC13E}
Expand Down
25 changes: 21 additions & 4 deletions BookGenShell.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# -----------------------------------------------------------------------------
# BookGen PowerShell Registration script
# Version 2.5
# Last modified: 2023-05-01
# Version 2.5.2
# Last modified: 2023-10-25
# -----------------------------------------------------------------------------

# cdg command
function cdg()
function cdg($args)
{
cdg.exe
if ([string]::IsNullOrWhiteSpace($arg))
{
cdg.exe
}
else
{
cdg.exe "$arg"
}
$location = [Environment]::GetEnvironmentVariable('cdgPath', 'User')
Push-Location $location
}
Expand Down Expand Up @@ -41,6 +48,16 @@ function intro()
Write-Host " \ /\"
Write-Host " ( )"
Write-Host " .( o )."

Bookgen.exe terminalinstall -t
if ($LastExitCode -eq 0) {
Bookgen.exe terminalinstall -c
if ($LastExitCode -ne 0) {
Write-Host ""
Write-Host "To install this shell as a windows terminal profile run:";
Write-Host "Bookgen terminalinstall"
}
}
}

#Set UTF8 encoding
Expand Down
10 changes: 10 additions & 0 deletions Bootstrappers/BookGen/BookGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
<ApplicationIcon>..\..\Icon.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<None Remove="Documents.html" />
</ItemGroup>

<ItemGroup>
<Content Include="Documents.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Bookgen.Win\Bookgen.Win.csproj" />
</ItemGroup>
Expand Down
21 changes: 21 additions & 0 deletions Bootstrappers/BookGen/Documents.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css">
<title>BookGen</title>
</head>
<body>
<main class="container">
<h1>Welcome to BookGen!</h1>
<ul>
<li><a target="_blank" href="data/Commands.html">Commands help</a></li>
<li><a target="_blank" href="data/Markdown-cheatsheet.html">Markdown basics</a></li>
<li><a target="_blank" href="data/ChangeLog.html">Change log</a></li>
<li><a target="_blank" href="data/RelaseNotes.html">Release Notes</a></li>
<li><a target="_blank" href="https://github.com/webmaster442/BookGen">Github</a></li>
</ul>
</main>
</body>
</html>
11 changes: 8 additions & 3 deletions Bootstrappers/BookGen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ public static void Main()
{
InstallVerify.ThrowIfNotExist();
var processBuilder = new ProcessBuilder();
if (InstallDetector.IsInstalled(Constants.WindowsTerminal))

if (InstallDetector.IsWindowsTerminalPortalbeInstalled(out string portable))
{
StartTerminal(shellExe, shellScript, processBuilder, portable);
}
else if (InstallDetector.IsInstalled(Constants.WindowsTerminal))
{
StartTerminal(shellExe, shellScript, processBuilder);
}
Expand Down Expand Up @@ -60,10 +65,10 @@ private static void StartPowershell(string shellExe, string shellScript, Process
}
}

private static void StartTerminal(string shellExe, string shellScript, ProcessBuilder processBuilder)
private static void StartTerminal(string shellExe, string shellScript, ProcessBuilder processBuilder, string terminalPath = Constants.WindowsTerminal)
{
using (var process = processBuilder
.SetProgram(Constants.WindowsTerminal)
.SetProgram(terminalPath)
.SetArguments(new[] {
"new-tab",
"-p",
Expand Down
21 changes: 21 additions & 0 deletions Bootstrappers/Bookgen.Win/InstallDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@ namespace Bookgen.Win
{
public static class InstallDetector
{
public static bool IsWindowsTerminalPortalbeInstalled(out string portablePath)
{
string[] searchPaths = new[]
{
Path.Combine(AppContext.BaseDirectory, "terminal", Constants.WindowsTerminal),
Path.Combine(AppContext.BaseDirectory, "wt", Constants.WindowsTerminal),
};

foreach (var searchPath in searchPaths)
{
if (File.Exists(searchPath))
{
portablePath = searchPath;
return true;
}
}

portablePath = string.Empty;
return false;
}

public static bool IsInstalled(string programName)
{
string[] pathDirs = Environment.GetEnvironmentVariable("path")?.Split(';') ?? Array.Empty<string>();
Expand Down
15 changes: 9 additions & 6 deletions Bootstrappers/Bootstrappers.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookGen", "BookGen\BookGen.csproj", "{45095BC4-0F34-4087-A859-1227763AFA0E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookGen", "BookGen\BookGen.csproj", "{45095BC4-0F34-4087-A859-1227763AFA0E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookGen.Launcher", "BookGen.Launcher\BookGen.Launcher.csproj", "{D6228E0E-AD04-443A-B177-671FFBC58E21}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookGen.Launcher", "BookGen.Launcher\BookGen.Launcher.csproj", "{D6228E0E-AD04-443A-B177-671FFBC58E21}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bookgen.Win", "Bookgen.Win\Bookgen.Win.csproj", "{9832DC6D-3F44-4221-BB59-2FF64D650C56}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bookgen.Win", "Bookgen.Win\Bookgen.Win.csproj", "{9832DC6D-3F44-4221-BB59-2FF64D650C56}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{45095BC4-0F34-4087-A859-1227763AFA0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{45095BC4-0F34-4087-A859-1227763AFA0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
Expand All @@ -31,4 +28,10 @@ Global
{9832DC6D-3F44-4221-BB59-2FF64D650C56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9832DC6D-3F44-4221-BB59-2FF64D650C56}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E6C21A96-CFC5-4F86-A793-913F058FC1C1}
EndGlobalSection
EndGlobal
16 changes: 15 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
# 2023
* New: Based on .NET 8
* New: Linux install script
* New: Windows builds with bootstappers
* New: Laucnher includes a markdown cheat sheet
* New: HTML2OPDF command (Windows only)
* New: Launcher includes a news channel
* New: Launcher has built-in task list
* New: HTML2PDF command (Windows only)
* New: Program in Directly runnable form, packed as ISO image
* New: Terminal output renderer, when building markdown
* New: CDG program can handle a path argument, to specify where to start from
* New: WWW program that can perform web searches easily
* Change: StockSearch command functionality has been integrated to the WWW command
* Change: Removed auto updater (hard to maintain)
* Change: Removed ZIP format release
* Change: Folder locking is now process based
* Change: Improved stat command
* Change: HTTP server has favicons & last acces time is sent in header
* Change: Replaces File based folder locking wiht a process based one
* Change: Auto updater removed, because of multiple platform issues
* Change: Launcher file browser usability improvements
* Change: Updated component dependencies
* Fix: Image convert command correctly handles SVG files
* Fix: ImgSearch correctly handles spaces in query
* Fix: Shell now sets UTF-8 encoding for output
Expand Down
Loading

0 comments on commit 4470ee1

Please sign in to comment.