-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
closes #505
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
semi: true | ||
tabWidth: 4 | ||
trailingComma: "all" | ||
singleQuote: false | ||
arrowParens: "avoid" | ||
printWidth: 120 | ||
endOfLine: "auto" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
``` | ||
$ USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
hide_table_of_contents: true | ||
--- | ||
CSharpier can be used to programmatically format code. | ||
|
||
This requires adding the [CSharpier.Core](https://www.nuget.org/packages/CSharpier.Core/) nuget package to your project. | ||
```bash | ||
dotnet add package CSharpier.Core | ||
``` | ||
|
||
```csharp | ||
|
||
var unformattedCode = "public class ClassName { }" | ||
|
||
var formattedCode = CodeFormatter.Format(unformattedCode); | ||
var asyncFormattedCode = await CodeFormatter.FormatAsync(unformattedCode); | ||
|
||
var options = new CodeFormatterOptions { Width = 60 }; | ||
|
||
var narrowerCode = CodeFormatter.Format(unformattedCode, options); | ||
var asyncNarrowerCode = await CodeFormatter.FormatAsync(unformattedCode, options); | ||
|
||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: What is CSharpier? | ||
id: About | ||
hide_table_of_contents: true | ||
--- | ||
|
||
CSharpier is an opinionated code formatter for c#. It uses Roslyn to parse your code and re-prints it using its own rules. | ||
The printing process was ported from [prettier](https://github.com/prettier/prettier) but has evolved over time. | ||
|
||
CSharpier provides a few basic options that affect formatting and has no plans to add more. It follows the [Option Philosophy](https://prettier.io/docs/en/option-philosophy.html) of prettier. | ||
|
||
### Before | ||
```csharp | ||
public class ClassName { | ||
public string ShortPropertyName { | ||
get; | ||
set; | ||
} | ||
|
||
public void LongUglyMethod(string longParameter1, string longParameter2, string longParameter3) { | ||
this.LongUglyMethod("1234567890", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); | ||
} | ||
} | ||
``` | ||
|
||
### After | ||
```csharp | ||
public class ClassName | ||
{ | ||
public string ShortPropertyName { get; set; } | ||
|
||
public void LongUglyMethod( | ||
string longParameter1, | ||
string longParameter2, | ||
string longParameter3 | ||
) | ||
{ | ||
this.LongUglyMethod( | ||
"1234567890", | ||
"abcdefghijklmnopqrstuvwxyz", | ||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" | ||
); | ||
} | ||
} |