Skip to content

Commit

Permalink
Update Website to docusaurus v3 (#1200)
Browse files Browse the repository at this point in the history
* Update to docusaurus 3

* Update prism config

* class -> className

* Fixes for highlighting

* Newline at end of file

* Update docs folder

---------

Co-authored-by: Bela VanderVoort <twobitbela@gmail.com>
  • Loading branch information
Strepto and belav authored Mar 15, 2024
1 parent b13673a commit 44c380d
Show file tree
Hide file tree
Showing 14 changed files with 7,556 additions and 16,195 deletions.
4 changes: 2 additions & 2 deletions Src/Website/docs/About.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CSharpier can also format [on save in your editor](https://csharpier.com/docs/Ed
---

### Before
```c#
```csharp
public class ClassName {
public void CallMethod() {
var shuffle = shuffle.Skip(26).LogQuery("Bottom Half").InterleaveSequenceWith(shuffle.Take(26).LogQuery("Top Half"), shuffle.Skip(26).LogQuery("Bottom Half")).LogQuery("Shuffle").ToArray();
Expand All @@ -39,7 +39,7 @@ public class ClassName {
```

### After
```c#
```csharp
public class ClassName
{
public void CallMethod()
Expand Down
8 changes: 4 additions & 4 deletions Src/Website/docs/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ hide_table_of_contents: true
Use the `dotnet csharpier` command to run CSharpier from the command line.

In practice, it will look something like:
```
```shell
dotnet csharpier .
```
This command will format all c# files in the current directory and its children.
Expand Down Expand Up @@ -37,8 +37,8 @@ Options:

```

### \[<directoryOrFile\>]
### `[<directoryOrFile\>]`

If a list of paths is supplied
- if the path points to an existing file, CSharpier will format that file
- if the path points to an existing directory, CSharpier will recursively format the contents of that directory
Expand Down Expand Up @@ -109,7 +109,7 @@ By default CSharpier will format files in place. This option allows you to write
If you pipe input to CSharpier it will also write the formatting results to stdout.

*TestFile.cs*
```c#
```csharp
public class ClassName
{
public string Field;
Expand Down
2 changes: 1 addition & 1 deletion Src/Website/docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Currently CSharpier only has basic support for understanding how to format code
It will attempt to determine which sets of preprocessor symbols are needed for roslyn to parse all the code in each file.

For example in the following code block, the following symbol sets would be needed ["FIRST", "SECOND,THIRD", ""]
```c#
```csharp
#if FIRST
// some code
#elif SECOND && THIRD
Expand Down
1 change: 0 additions & 1 deletion Src/Website/docs/ContinuousIntegration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ Normally when using a code formatter like CSharpier, you'll want to ensure that
dotnet csharpier --check .
```

10 changes: 5 additions & 5 deletions Src/Website/docs/Ignore.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Use `csharpier-ignore` comments to bypass formatting specific parts of files.
Add a `.csharpierignore` file to ignore additional files and folders. The file uses [gitignore syntax](https://git-scm.com/docs/gitignore#_pattern_format)

Example
```
```ignore
Uploads/
**/App_Data/*.cs
```
Expand All @@ -38,7 +38,7 @@ _See [Configuration](CLI.md) for including these files_

Add a `// csharpier-ignore` comment to exclude the next node from formatting. This is valid on statements and members.

```c#
```csharp

// csharpier-ignore
public class Unformatted {
Expand Down Expand Up @@ -71,7 +71,7 @@ public class ClassName
```

Use a ranged ignore to exclude multiple lines from formatting. A range is valid around statements and members.
```c#
```csharp
// csharpier-ignore-start
public class Unformatted1 { }
public class Unformatted2 { }
Expand Down Expand Up @@ -110,7 +110,7 @@ public class ClassName

As of 0.23.0 both types of ignores can include a description as part of the comment. The description must be seperated from the comment by at least one - character.

```c#
```csharp
// csharpier-ignore - class copied as-is from another project
public class Unformatted {
private string unformatted;
Expand All @@ -120,4 +120,4 @@ public class Unformatted {
public class Unformatted1 { }
public class Unformatted2 { }
// csharpier-ignore-end
```
```
11 changes: 5 additions & 6 deletions Src/Website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
const prismReactRenderer = require("prism-react-renderer");

const githubUrl = "https://github.com/belav/csharpier";

Expand Down Expand Up @@ -60,7 +59,7 @@ const config = {
},
{
href: githubUrl,
html: "<span aria-hidden=\"true\">GitHub</span>",
html: '<span aria-hidden="true">GitHub</span>',
position: "right",
class: "navbar__item navbar__link header-github-link",
},
Expand Down Expand Up @@ -110,9 +109,9 @@ const config = {
],
},
prism: {
additionalLanguages: ["csharp"],
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ["csharp", "bash", "powershell", "json", "editorconfig", "yaml", "ignore"],
theme: prismReactRenderer.themes.github,
darkTheme: prismReactRenderer.themes.dracula,
},
}),
};
Expand Down
Loading

0 comments on commit 44c380d

Please sign in to comment.