Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
NeVeSpl committed Dec 18, 2022
1 parent d821852 commit 34b3eed
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 27 deletions.
13 changes: 0 additions & 13 deletions Documentation/CLI.md

This file was deleted.

8 changes: 5 additions & 3 deletions Documentation/Configuration.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
## Configuration

### Nugets

To create global configuration for your templates you will need this one:
For using global configuration from user code (*.nt.cs), local configuration does not need one.

https://www.nuget.org/packages/NTypewriter.Editor.Config/

### Local vs Global configuration

All available here options you can set in two ways:
All available here options can be set in two ways:
- in separate c# file (with *.nt.cs extension) that will be used by all templates in the given project (aka global configuration)
- inside *.nt template (aka local configuration)

Expand All @@ -15,7 +17,7 @@ If both configuration options are used, the local configuration will overwrite t

Files that contain global configuration are detected by file extension : *.nt.cs.

How global configuration is discovered and compiled, you can see in [UserCodeLoader.cs](/NTypewriter.Runtime/UserCode/UserCodeLoader.cs)
How global configuration is discovered and compiled, you can see in [UserCodeLoader.cs](../NTypewriter.Runtime/UserCode/UserCodeLoader.cs)

### AddGeneratedFilesToVSProject

Expand Down
4 changes: 3 additions & 1 deletion Documentation/CustomFunctions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Custom functions

### Nugets

This nuget gives you access to code model abstractions.
This nuget gives access to code model abstractions:

https://www.nuget.org/packages/NTypewriter.CodeModel/

Expand Down
4 changes: 3 additions & 1 deletion Documentation/EditorForVisualStudio.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
### Getting started with NTypewriter editor for Visual Studio
## NTypewriter editor for Visual Studio

### Getting started

1) <a name="Install"></a>Install [NTypewriter editor for Visual Studio](https://marketplace.visualstudio.com/items?itemName=NeVeS.NTypewriterEditorForVisualStudio)
2) Add template file with *.nt extension to your project
Expand Down
24 changes: 24 additions & 0 deletions Documentation/NTypewriter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## NTypewriter, nuget

### Build your own CLI

There is no official CLI version of NTypewriter, you can build your own easily since NTypewriter does not require the presence of VisualStudio. The hardest part is to acquire a valid instance of `Microsoft.CodeAnalysis.Compilation`, but [Buildalyzer
](https://github.com/daveaglick/Buildalyzer) will help with that.

#### Nugets

To do that you will need a few nugets:

https://www.nuget.org/packages/NTypewriter/

https://www.nuget.org/packages/NTypewriter.CodeModel.Roslyn/

https://www.nuget.org/packages/Buildalyzer.Workspaces/

#### Example

And how to do that you can see here:

[DocumentationGenerator/Program.cs](../DocumentationGenerator/Program.cs)

The documentation page for "CodeModel" is generated by the above CLI program.
2 changes: 1 addition & 1 deletion Documentation/SourceGenerator.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on every change in source code | yes | no | no
when template (*.nt) is saved | no | no | yes (opt-in)
on demend | no| no | yes

### Nuget
### Nugets

https://www.nuget.org/packages/NTypewriter.SourceGenerator

Expand Down
2 changes: 1 addition & 1 deletion NTypewriter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentat
ProjectSection(SolutionItems) = preProject
Documentation\Architecture.md = Documentation\Architecture.md
Documentation\BuiltInFunctions.md = Documentation\BuiltInFunctions.md
Documentation\CLI.md = Documentation\CLI.md
Documentation\CodeModel.md = Documentation\CodeModel.md
Documentation\Configuration.md = Documentation\Configuration.md
Documentation\CustomFunctions.md = Documentation\CustomFunctions.md
Documentation\EditorForVisualStudio.md = Documentation\EditorForVisualStudio.md
Documentation\NameVariants.md = Documentation\NameVariants.md
Documentation\NTypewriter.CodeModel.flowchart.mmd = Documentation\NTypewriter.CodeModel.flowchart.mmd
Documentation\SourceGenerator.md = Documentation\SourceGenerator.md
Documentation\NTypewriter.md = Documentation\NTypewriter.md
Documentation\TypewriterIssues.md = Documentation\TypewriterIssues.md
EndProjectSection
EndProject
Expand Down
14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![ci](https://github.com/NeVeSpl/NTypewriter/actions/workflows/CI.yml/badge.svg)](https://github.com/NeVeSpl/NTypewriter/actions/workflows/CI.yml)
[![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/NeVeS.NTypewriterEditorForVisualStudio?color=%230429FF&label=NTypewriter%20editor)](https://marketplace.visualstudio.com/items?itemName=NeVeS.NTypewriterEditorForVisualStudio)
[![Nuget](https://img.shields.io/nuget/v/NTypewriter.SourceGenerator?color=%23004880&label=NTypewriter.SourceGenerator)](https://www.nuget.org/packages?q=NTypewriter.SourceGenerator)
[![Nuget](https://img.shields.io/nuget/v/NTypewriter.SourceGenerator?color=%23004880&label=NTypewriter.SourceGenerator)](https://www.nuget.org/packages/NTypewriter.SourceGenerator)
[![Nuget](https://img.shields.io/nuget/v/NTypewriter?color=%23004880&label=NTypewriter%20nugets)](https://www.nuget.org/packages?q=NTypewriter)

![NTypewriter LivePreview](Documentation/LivePreview.gif)
Expand All @@ -23,12 +23,12 @@ With NTypewriter you can:
- create a typed TypeScript API client for your ASP.net web API

NTypewriter comes in many flavours, that can be used according to your needs:
- [NTypewriter editor for Visual Studio](Documentation/EditorForVisualStudio.md) - extension for Visual Studio that adds support for editing *.nt templates, with syntax highlighting, code completion, live preview, design time rendering, [available on vs marketplace](https://marketplace.visualstudio.com/items?itemName=NeVeS.NTypewriterEditorForVisualStudio)
- [NTypewriter.SourceGenerator](Documentation/SourceGenerator.md) - nuget, Roslyn source generator that renders *.nt templates during compilation, since it is compiler extension, it can be used with any IDE or CI/pipeline that supports source generators
- NTypewriter - nuget, library that enables you to create run time solution which will be able to render *.nt templates, for example, [your own CLI](Documentation/CLI.md)
- [NTypewriter editor for Visual Studio](Documentation/EditorForVisualStudio.md#NTypewriter-editor-for-Visual-Studio) - extension for Visual Studio that adds support for editing *.nt templates, with syntax highlighting, code completion, live preview, design time rendering, [available on vs marketplace](https://marketplace.visualstudio.com/items?itemName=NeVeS.NTypewriterEditorForVisualStudio)
- [NTypewriter.SourceGenerator](Documentation/SourceGenerator.md#NTypewriter.SourceGenerator) - nuget, Roslyn source generator that renders *.nt templates during compilation, since it is compiler extension, it can be used with any IDE or CI/pipeline that supports source generators
- NTypewriter - nuget, library that enables you to create run time solution which will be able to render *.nt templates, for example: [your own CLI](Documentation/NTypewriter.md#Build-your-own-CLI)
- NTypewriter.CodeModel.Roslyn - nuget, library that exposes C# code model from an instance of `Microsoft.CodeAnalysis.Compilation`, useful if you would like to use different template engine

more about NTypewriter architecture and all extension points that you can use, you filnd [here](Documentation/Architecture.md)
more about NTypewriter architecture and all extension points that can be used, you will find [here](Documentation/Architecture.md#NTypewriter-architecture)


<ins>For those who know Typewriter</ins>:
Expand All @@ -52,15 +52,15 @@ Oh, did I forget to mention that NTypewriter also solves most of the awaited iss
* [Typewriter vs NTypewriter](#Typewriter-vs-NTypewriter)
* [Examples: *.nt templates](#Examples)
* Getting started
* [NTypewriter editor for Visual Studio](Documentation/EditorForVisualStudio.md#Getting-started-with-NTypewriter-editor-for-Visual-Studio)
* [NTypewriter editor for Visual Studio](Documentation/EditorForVisualStudio.md#Getting-started)
* [Install](Documentation/EditorForVisualStudio.md#Install)
* [CodeModel](Documentation/EditorForVisualStudio.md#CodeModel)
* [Capture](Documentation/EditorForVisualStudio.md#Capture)
* [Save](Documentation/EditorForVisualStudio.md#Save)
* [Run](Documentation/EditorForVisualStudio.md#Run)
* [When something goes wrong](Documentation/EditorForVisualStudio.md#Error)
* [NTypewriter.SourceGenerator](Documentation/SourceGenerator.md)
* [Build your own CLI](Documentation/CLI.md)
* [Build your own CLI](Documentation/NTypewriter.md#Build-your-own-CLI)
* Documentation
* [Template language](https://github.com/scriban/scriban/blob/master/doc/language.md)
* [Code model](Documentation/CodeModel.md)
Expand Down

0 comments on commit 34b3eed

Please sign in to comment.