diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-05 03:25:53 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-05 03:25:53 +0200 |
commit | 51d820e22a4517dbb06d38a4f07f7c48522ef811 (patch) | |
tree | 4a7749cf77223dff2414fd4b73cb17df43d7449e /GitStaticPageBuilder | |
download | GitTools-master.tar.xz |
Diffstat (limited to 'GitStaticPageBuilder')
-rw-r--r-- | GitStaticPageBuilder/GitStaticPageBuilder.csproj | 21 | ||||
-rw-r--r-- | GitStaticPageBuilder/Pages/RepoPage.cs | 14 | ||||
-rw-r--r-- | GitStaticPageBuilder/Program.cs | 14 | ||||
-rw-r--r-- | GitStaticPageBuilder/Resources/RepoPage.html | 12 | ||||
-rw-r--r-- | GitStaticPageBuilder/output/repo.html | 10 | ||||
-rw-r--r-- | GitStaticPageBuilder/output/repo.json | 5 |
6 files changed, 76 insertions, 0 deletions
diff --git a/GitStaticPageBuilder/GitStaticPageBuilder.csproj b/GitStaticPageBuilder/GitStaticPageBuilder.csproj new file mode 100644 index 0000000..2858582 --- /dev/null +++ b/GitStaticPageBuilder/GitStaticPageBuilder.csproj @@ -0,0 +1,21 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net7.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="..\LibGit\LibGit.csproj" /> + </ItemGroup> + + <ItemGroup> + <Folder Include="Resources\" /> + <Content Include="Resources\**"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + </ItemGroup> + +</Project> diff --git a/GitStaticPageBuilder/Pages/RepoPage.cs b/GitStaticPageBuilder/Pages/RepoPage.cs new file mode 100644 index 0000000..d0aac1e --- /dev/null +++ b/GitStaticPageBuilder/Pages/RepoPage.cs @@ -0,0 +1,14 @@ +using System.Text.Encodings.Web; +using LibGit; + +namespace GitStaticPageBuilder.Pages; + +public class RepoPage +{ + public static string GetRepoPage(GitRepo repo) + { + var basePage = File.ReadAllText("Resources/RepoPage.html"); + + return basePage; + } +} \ No newline at end of file diff --git a/GitStaticPageBuilder/Program.cs b/GitStaticPageBuilder/Program.cs new file mode 100644 index 0000000..e70e3c0 --- /dev/null +++ b/GitStaticPageBuilder/Program.cs @@ -0,0 +1,14 @@ +// See https://aka.ms/new-console-template for more information + +using GitStaticPageBuilder.Pages; +using LibGit; +using LibGit.Extensions; + +Console.WriteLine("Hello, World!"); + +var repo = new GitRepo("/home/root@Rory/git/spacebar/server/.git"); +Console.WriteLine(repo.ToJson(ignoreNull: false, indent: true, unsafeContent: true)); +if(!Directory.Exists("output")) + Directory.CreateDirectory("output"); +File.WriteAllText("output/repo.json", repo.ToJson(ignoreNull: false, indent: true, unsafeContent: true)); +File.WriteAllText("output/repo.html", RepoPage.GetRepoPage(repo)); \ No newline at end of file diff --git a/GitStaticPageBuilder/Resources/RepoPage.html b/GitStaticPageBuilder/Resources/RepoPage.html new file mode 100644 index 0000000..e9ba4fb --- /dev/null +++ b/GitStaticPageBuilder/Resources/RepoPage.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Repository</title> +</head> +<body> + <h1>$NAME</h1> + <p>$DESCRIPTION</p> + <p></p> +</body> +</html> \ No newline at end of file diff --git a/GitStaticPageBuilder/output/repo.html b/GitStaticPageBuilder/output/repo.html new file mode 100644 index 0000000..9cbfb90 --- /dev/null +++ b/GitStaticPageBuilder/output/repo.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Repository</title> +</head> +<body> + +</body> +</html> \ No newline at end of file diff --git a/GitStaticPageBuilder/output/repo.json b/GitStaticPageBuilder/output/repo.json new file mode 100644 index 0000000..f2140f4 --- /dev/null +++ b/GitStaticPageBuilder/output/repo.json @@ -0,0 +1,5 @@ +{ + "RepoPath": "/home/root@Rory/git/spacebar/server/.git", + "Name": null, + "Description": "Spacebar Server - TypeScript version\n" +} \ No newline at end of file |