Code Monkey home page Code Monkey logo

csharptocolouredhtml's People

Contributors

swiftly1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

csharptocolouredhtml's Issues

Highlighting Important Lines

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.

Line Numbers in CLI Sample only does line 0

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?

2022-11-16_22-58-06
2022-11-16_22-56-55

Special Use Case - Unity - Built-in Methods (Messaging System) are Coloured Like Keywords

Note: not really an issue. More a special use case that is not currently supported.

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...

My initial issue:

1 My Issue
2 My Ideal Situation

My implemented fix:

3 My Fix

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;
        }

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.