Coder Social home page Coder Social logo

Comments (5)

withinsight avatar withinsight commented on June 2, 2024 2

Any examples of customizing Theo's formatOptions out there?

from theo.

withinsight avatar withinsight commented on June 2, 2024

Still no luck here. Anybody?!?

from theo.

axyz avatar axyz commented on June 2, 2024

@withinsight I have the same issue, haven't digged too much into the code, but as far as I can tell it is not possible to pass options to the convert function.

What happen with the setup file is that it gives you the theo object so that you can decorate it before the convert function is called, but you cannot call the convert function yourself there.

I think the only options here would be to either use the full API and write a simple script to call theo.convert yourself or use registerFormat to reimplement the html format in your setup file omitting the camel case part.

But maybe some maintainer may have some more insights here.

from theo.

myamolane avatar myamolane commented on June 2, 2024

@withinsight Hey, this should works, take a try ~
const htmlFormat = require('theo/lib/formats/html'); theo.registerFormat( 'html', (result) => { const newResult = result.set('options', { transformPropName: (propName) => { // convert to whatevery case you want return propName; } }) return htmlFormat(newResult) } )

image

from theo.

myamolane avatar myamolane commented on June 2, 2024

Another way, pass the transformPropName through formatOptions
image

from theo.

Related Issues (20)

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.