Git Product home page Git Product logo

literatecs's Introduction

Build status NuGet Version

Literate Programming in C# and .NET Core

LiterateCS is a Literate Programming tool that produces clear, professional-looking documentation automatically from your C# projects. It parses C# code files and extracts markdown documentation from comments. Alternatively you can write your documentation in separate markdown files and interleave pieces of code in them by referring to C# regions. LiterateCS can then create either a simple markdown output that you can upload to your project's wiki pages, or it can generate a full-blown static web site that you can host in GitHub Pages.

The idea of literate programming differs from the usual way of thinking about technical documentation. Instead of documentation being an afterthough which is taken care of after the project is done, literate programming encourages you to document your code while you are writing it. Also, you don't write your documentation as an API reference like with xmldoc comments, but rather like text of an essay, explaining the things that need explaining and skipping the obvious parts.

To get an idea about how this works in practice, refer to the literate documentation created from this project. It can be found at:

https://johtela.github.io/LiterateCS/

Other examples of documentation created with LiterateCS can be found at:

Quickstart

To create your first literate program install first the literatecs tool with command line:

> dotnet tool install -g literatecs

Then install the project template.

> dotnet new -i LiterateCS.Templates.LiterateLib.CSharp

After that create a new directory and the project skeleton.

> mkdir MyLiteratePony
> cd MyLiteratePony
> dotnet new literatelib

You should now have files for your class library created. You can build the project with.

> dotnet build

To check what you got, you can open your project in Visual Studio Code (this step is optional).

> code .

You should see the following project structure.

...VSCode screenshot...

Finally you can create the documentation from your project with:

> literatecs

To see the generated documentation open the docs/index.html page in a web browser.

...Generated docs in browser...

Download and Installation

The project was initially written for .NET Framework, but I recently modified it to target .NET Core 2.1. It is available in https://nuget.org as an .NET Core global tool.

See the installation instructions for more details. Documentation of the command line options and usage examples can be found here.

Bug Reports & Feedback

If you find a bug or want to suggest a feature, you can submit an issue.

If you want to contribute to the development, let me know. All help is appreciated.

literatecs's People

Watchers

James Cloos avatar Mark Chipman and sidekick Mollie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.