Skip to content

Commit

Permalink
Adding Files
Browse files Browse the repository at this point in the history
  • Loading branch information
“hphan9” committed Nov 14, 2021
1 parent 624ac23 commit 23c766a
Show file tree
Hide file tree
Showing 18 changed files with 1,698 additions and 0 deletions.
454 changes: 454 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# shinny-ssg Version 0.1 - CLI Tool to generate HTML File

## Prerequisites
* .NetCore 3.1

## Setup
* Download or clone source code
* Cd to the solution repository
* Install dotnet-format with command: dotnet tool install -g dotnet-format
* Build project with dotnet build
* Format code: The source code will be auto format when the project is built or with command: dotnet-format -a warn ./shinny-ssg.sln

## Editor/IDE Integration
Import the file ShinnySSG-2021-11-06.vssettings to Visual Studio to have the same development environment.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# shinny-ssg Version 0.1 - CLI Tool to generate HTML File

## Features
* generate .html files from .txt files and .md files
* accept folder as input path to generate .html files in the destionation folder which will has the same structure as the original folder
* give user the options to specify destination folder, language attribute for HTML files and/or stylesheet url link

## How to use
* Download or clone the shinny-ssg folder to your local machine
* Use command prompt to navigate to the folder netcoreapp3.1 in the shinny-ssg folder ( path `shinny-ssg\bin\Debug\netcoreapp3.1`)
* In the command prompt run `shinny-ssg.exe -h` to see the options
* The file will be generated in the `shinny-ssg\bin\Debug\netcoreapp3.1\dist` folder by default or in the destination folder if specified by user
* If there is no error, the app exits with code 0, otherwhise it exits with code -1
### Command
> shinny-ssg.exe -h
>
> shinny-ssg.exe -i `<filePath>`
>
> shinny-ssg.exe -i `<path>` -o `<folder path>` -s `<stylesheet link>`
Option Function


| OPTION | Function |
| ------------------ |:-----------------------------------:|
| -v --version | Name and version |
| -h --help | Information |
| -s --stylesheet | <'link-to-css-stylesheet'> |
| -i --input | specifies an input file or folder |
| -o --output | specifies destination folder |
| -l --lang | specifies language atrribute |
| -c --config | accept a file path to a JSON config file |


### Built with
* .NET CORE 3.1
* [Command Line Utils](https://github.com/natemcmaster/CommandLineUtils)

### Sample HTML file
https://hphan9.github.io/shinny-ssg.html

### License
MIT

### Author
Emily Phan

217 changes: 217 additions & 0 deletions shinny-ssg/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
###############################
# Core EditorConfig Options #
###############################
root = true
# All files
[*]
indent_style =tab
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
charset = utf-8-bom
###############################
# .NET Coding Conventions #
###############################
[*.{cs,vb}]
# Organize usings
dotnet_sort_system_directives_first = true
# this. preferences
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_readonly_field = true:suggestion
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
###############################
# Naming Conventions #
###############################
# Style Definitions
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Use PascalCase for constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const
###############################
# C# Coding Conventions #
###############################
[*.cs]
# var preferences
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# Null-checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
# Expression-level preferences
csharp_prefer_braces = true:silent
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
###############################
# C# Formatting Rules #
###############################
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else =true
csharp_new_line_before_catch =true
csharp_new_line_before_finally =true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
csharp_indent_braces=true
###############################
# VB Coding Conventions #
###############################

# SA1027: Use tabs correctly
dotnet_diagnostic.SA1027.severity = none

[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion

##
## StyleCop.Analyzers
##

# Using directive should appear within a namespace declaration
dotnet_diagnostic.SA1200.severity = None

# XML comment analysis is disabled due to project configuration
dotnet_diagnostic.SA0001.severity = None

# The file header is missing or not located at the top of the file
dotnet_diagnostic.SA1633.severity = None

# Use string.Empty for empty strings
dotnet_diagnostic.SA1122.severity = None

# Variable '_' should begin with lower-case letter
dotnet_diagnostic.SA1312.severity = None

# Parameter '_' should begin with lower-case letter
dotnet_diagnostic.SA1313.severity = None

# Elements should be documented
dotnet_diagnostic.SA1600.severity = None

# Prefix local calls with this
dotnet_diagnostic.SA1101.severity = None

# 'public' members should come before 'private' members
dotnet_diagnostic.SA1202.severity = None

# Comments should contain text
dotnet_diagnostic.SA1120.severity = None

# Constant fields should appear before non-constant fields
dotnet_diagnostic.SA1203.severity = None

# Field '_blah' should not begin with an underscore
dotnet_diagnostic.SA1309.severity = None

# Use trailing comma in multi-line initializers
dotnet_diagnostic.SA1413.severity = None

# A method should not follow a class
dotnet_diagnostic.SA1201.severity = None

# Elements should be separated by blank line
dotnet_diagnostic.SA1516.severity = None

# The parameter spans multiple lines
dotnet_diagnostic.SA1118.severity = None

# Static members should appear before non-static members
dotnet_diagnostic.SA1204.severity = None

# Put constructor initializers on their own line
dotnet_diagnostic.SA1128.severity = None

# Opening braces should not be preceded by blank line
dotnet_diagnostic.SA1509.severity = None

# The parameter should begin on the line after the previous parameter
dotnet_diagnostic.SA1115.severity = None

# File name should match first type name
dotnet_diagnostic.SA1649.severity = None

# File may only contain a single type
dotnet_diagnostic.SA1402.severity = None

# Enumeration items should be documented
dotnet_diagnostic.SA1602.severity = None

# Element should not be on a single line
dotnet_diagnostic.SA1502.severity = None

# Closing parenthesis should not be preceded by a space
dotnet_diagnostic.SA1009.severity = None

# Closing parenthesis should be on line of last parameter
dotnet_diagnostic.SA1111.severity = None

# Braces should not be ommitted
dotnet_diagnostic.SA1503.severity = None

#TabsMustNotBeUsed
dotnet_diagnostic.SA1027.severity = None
21 changes: 21 additions & 0 deletions shinny-ssg/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Emily

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions shinny-ssg/Output-Build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Build started...
1>------ Build started: Project: shinny-ssg, Configuration: Debug Any CPU ------
1>C:\Users\khoit\Desktop\OSD600\shinny-ssg\Program.cs(68,34,68,36): warning CS0168: The variable 'ex' is declared but never used
1>shinny-ssg -> C:\Users\khoit\Desktop\OSD600\shinny-ssg\bin\Debug\netcoreapp3.1\shinny-ssg.dll
1>shinny-ssg -> C:\Users\khoit\Desktop\OSD600\shinny-ssg\bin\Debug\netcoreapp3.1\shinny-ssg.dll
1>Successfully created package 'C:\Users\khoit\Desktop\OSD600\shinny-ssg\bin\shinny-ssg.1.0.0.nupkg'.
1>Done building project "shinny-ssg.csproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
8 changes: 8 additions & 0 deletions shinny-ssg/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"shinny-ssg": {
"commandName": "Project",
"commandLineArgs": "-c C:\\Users\\khoit\\Desktop\\OSD600\\testConfig.json"
}
}
}
383 changes: 383 additions & 0 deletions shinny-ssg/ShinnySSG-2021-11-06.vssettings

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions shinny-ssg/shinny-ssg.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>shinny_ssg</RootNamespace>
<PackAsTool>true</PackAsTool>
<ToolCommandName>shinny </ToolCommandName>
<PackageOutputPath>./bin</PackageOutputPath>
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Test\**" />
<EmbeddedResource Remove="Test\**" />
<None Remove="Test\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>

<ItemGroup>
<EditorConfigFiles Remove="C:\Users\khoit\Desktop\OSD600\shinny-ssg\.editorconfig" />
</ItemGroup>

<ItemGroup>
<None Include="C:\Users\khoit\Desktop\OSD600\shinny-ssg\.editorconfig" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="dotnet-format . -f&#xD;&#xA;" />
</Target>

</Project>
31 changes: 31 additions & 0 deletions shinny-ssg/shinny-ssg.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "shinny-ssg", "shinny-ssg.csproj", "{FB4DD3A8-AA7D-4A4D-B9B2-C6805F84D776}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "shinny-ssgTests", "..\shinny-ssgTests\shinny-ssgTests.csproj", "{3E443E98-7882-40BB-B8BD-0CE065055056}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FB4DD3A8-AA7D-4A4D-B9B2-C6805F84D776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB4DD3A8-AA7D-4A4D-B9B2-C6805F84D776}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB4DD3A8-AA7D-4A4D-B9B2-C6805F84D776}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB4DD3A8-AA7D-4A4D-B9B2-C6805F84D776}.Release|Any CPU.Build.0 = Release|Any CPU
{3E443E98-7882-40BB-B8BD-0CE065055056}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E443E98-7882-40BB-B8BD-0CE065055056}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E443E98-7882-40BB-B8BD-0CE065055056}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E443E98-7882-40BB-B8BD-0CE065055056}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B63D8BA9-4B40-45BF-BE79-655D9F4C3FF9}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 23c766a

Please sign in to comment.