cloud-awesome / markdown-maker Goto Github PK
View Code? Open in Web Editor NEWLightweight library to assist creation of .md files (in GitHub and/or DocFX flavours)
License: MIT License
Lightweight library to assist creation of .md files (in GitHub and/or DocFX flavours)
License: MIT License
Started implementing during test refactoring, but most of the methods take this as an input.
e.g.
var table = new MdTable()
.AddColumn("First Column")
.AddColumn("Second Column")
.AddColumn("Third Column");
instead of
var table = new MdTable()
.AddColumn(new MdPlainText("First Column"))
.AddColumn(new MdPlainText("Second Column"))
.AddColumn(new MdPlainText("Third Column"));
Keep the original for backwards compatibility though
On top of Fitting and DocFX, as support for Azure DevOps wikis
e.g. code takes ::: instead of ```
Default to GFM but allow allow optimal parameter for AzDO flavour...
To allow for the generation of multiple .md files in one .save call
e.g.
const string folderPath = "c:/output-documents/";
var documentSet = new MdDocumentSet(folderPath)
.AddDocument(new MdDocument(...)
.AddDocument(new MdDocument(...)
.AddDocument(new MdDocument(...)
.Save();
Good use cases for this are:
To read and translate tables from other formats, e.g. pass in an Excel file and reference to a specific table
e.g.
var numberedList = new MdList(MdListType.Ordered)
.AddItem("First point")
.AddItem("Second point")
.AddChildList(new MdList(MdListType.Ordered) {
.AddItem("First child")
.AddItem("Second child")
})
.AddItem("Third point")
.AddItem("Fourth point");
produces:
- First point
- Second point
- First child
- Second child
- Third point
- Fourth point
rendered as:
e.g.
// This can be included in an MdParagraph instance
var footnote = new MdFootNote{
Reference: "1", // produces [^1] in markdown
Footnote: new MdParagraph("This is the text, that can include other children such as MdLink, etc. etc.")
};
N.B. An MdDocument instance will need a private dictionary of all footnotes, not just the usual .MarkDown getter used in other classes, that they can be processed at the end of the document.
Don't think this is supported outside of GitHub (yet?). Should it be included in a GitHub-specific namespace?
Before deleting and creating a new file, validate the output
Admittedly, it's not markdown at all, but it's a very quick, simple and useful addition (c.f. the DocfxYamlHeader class) and fits well with the other DocFX functionality so may as well keep them all together!
Related to #15
e.g.
var landingPage = new DocfxYamlFile(someFolderLandingPage)
// where someFolderLandingPage is a POCO object, based on a JSON schema
e.g. something to replace this:
var docfxMetadata =
"---" + Environment.NewLine +
"uid: this_is_a_tester" + Environment.NewLine +
"---";
new MdDocFxMetadata(key, value)
Also consider (but maybe later)
c.f. https://dotnet.github.io/docfx/spec/docfx_flavored_markdown.html?tabs=tabid-1%2Ctabid-a
e.g. use
var quote = new MdQuote()
{
"All the world’s a stage, and all the men and women merely players.",
"They have their exits and their entrances;",
"And one man in his time plays many parts."
};
on top of the existing
var quote = new MdQuote()
.AddLine(new MdPlainText("All the world’s a stage, and all the men and women merely players."))
.AddLine(new MdPlainText("They have their exits and their entrances;"))
.AddLine(new MdPlainText("And one man in his time plays many parts."));
Both are required.
DocFX is a documentation generation engine
DoxFX's documentation is pretty poor
Don't be like DocFx
;)
e.g.
var comment = new MdStrikeThroughText("This is a now redundant");
produces
~~This is a now redundant~~
for this:
This is a now redundant
With the option to set bool value - true/false
Results in:
or
To allow the return of the document's full markdown, without needing to write it out to the FileSystem
Things like MdTable.AddColumn() should be able to accept MdBoldText etc. as well as plain text
(c.f. MdItalicText, but better)
These currently accept MdPlainText or string:
These currently accept just a string:
e.g.
var comment = new MdComment("This is a comment");
produces
<!-- This is a comment -->
public MdDocument(string fileName, IDocumentMe pocoClass, IFileSystem fileSystem = null)
public MdDocument(string fileName, IEnumerable<IDocumentMe> pocoClasses,
IFileSystem fileSystem = null)
IDocumentPart
type to enable it to be embedded into a wider documentAdd validation for each child row
Exclude these from PR/Build pipelines, but include for local Dev and for repo consumers to run locally to actually produce real files (not mocking the filesystem...)
Also, ensure they're excluded from any Code Coverage metrics (locally and on SonarCloud)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.