swiftly1 / csharptocolouredhtml Goto Github PK
View Code? Open in Web Editor NEWC# to HTML Converter with syntax highlighting
Home Page: https://csharp-colors.xyz
License: MIT License
C# to HTML Converter with syntax highlighting
Home Page: https://csharp-colors.xyz
License: MIT License
.<span class="white"> System</span>
=>
. <span class="white">System</span>
Not required but I would love to have it...
Have you thought about adding the feature of highlighting lines (and/or just showing partial sections of code).
They do this in DocFX using some Markdown syntax.
See here for example syntax and usage:
You could allow the user to supply line numbers and just put tags around the line. I might have a go at implementing it myself.
Firstly, Just found this a few days ago and think this is a great library. I need something like this to embed nicely formatted code as HTML as the CMS I use is limited in what can be displayed within it.
Issue: I ran the CLI (using your sample test) and added line numbers but it only does line 0. See Attached Sample Output and slightly modified version of the CLI Program.cs. Any tips or suggestions on what I might be doing incorrectly?
Overview:
I am mostly using your library to convert C Sharp code that is used within Unity.
Within Visual Studio the integration allows built-in Unity method names (which are called by their messaging system - see here under Messages heading: Unity API on Monobehaviour) to be coloured like they are keywords.
This may not be something you wish to add but I thought I'd show you my fix - it works well for me. You may even have a suggestion regarding a better way to do it...
Code added in Hints.cs:
public List<string> ReallyPopularMethod { get; } = new List<string>
{
"Awake",
"FixedUpdate",
"LateUpdate",
"OnAnimatorIK",
"OnAnimatorMove",
"OnApplicationFocus",
"OnApplicationPause",
"OnApplicationQuit",
"OnAudioFilterRead",
"OnBecameInvisible",
"OnBecameVisible",
"OnBeforeTransformParentChanged",
"OnCanvasGroupChanged",
"OnCollisionEnter",
"OnCollisionEnter2D",
"OnCollisionExit",
"OnCollisionExit2D",
"OnCollisionStay",
"OnCollisionStay2D",
"OnConnectedToServer",
"OnControllerColliderHit",
"OnDestroy",
"OnDisable",
"OnDisconnectedFromMasterServer",
"OnDisconnectedFromServer",
"OnDrawGizmos",
"OnDrawGizmosSelected",
"OnEnable",
"OnFailedToConnect",
"OnFailedToConnectToMasterServer",
"OnGUI",
"OnJointBreak",
"OnJointBreak2D",
"OnLevelWasLoaded",
"OnMasterServerEvent",
"OnMouseDown",
"OnMouseDrag",
"OnMouseEnter",
"OnMouseExit",
"OnMouseOver",
"OnMouseUp",
"OnMouseUpAsButton",
"OnNetworkInstantiate",
"OnParticleCollision",
"OnParticleSystemStopped",
"OnParticleTrigger",
"OnParticleUpdateJobScheduled",
"OnPlayerConnected",
"OnPlayerDisconnected",
"OnPostRender",
"OnPreCull",
"OnPreRender",
"OnRectTransformDimensionsChange",
"OnRectTransformRemoved",
"OnRenderImage",
"OnRenderObject",
"OnSerializeNetworkView",
"OnServerInitialized",
"OnTransformChildrenChanged",
"OnTransformParentChanged",
"OnTriggerEnter",
"OnTriggerEnter2D",
"OnTriggerExit",
"OnTriggerExit2D",
"OnTriggerStay",
"OnTriggerStay2D",
"OnValidate",
"OnWillRenderObject",
"Reset",
"Start",
"Update"
};
Code added in HeuristicsGenerator.cs, at end of PostProcess method:
//Added This for Unity Built-In Method Color Support
for (int i = 0; i < alreadyProcessed.Count; i++)
{
var current = alreadyProcessed[i];
if (_Hints.ReallyPopularMethod.Contains(current.Text))
current.Colour = NodeColors.Keyword;
}
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.