Code Monkey home page Code Monkey logo

Comments (5)

zakhenry avatar zakhenry commented on June 16, 2024 1

@dgomesbr can you please explain your use case? If you have node installed you don't really need to use npm - you can use npx which comes bundled with node which allows you to use node based utilities in a super simple way. just npx embedme path/to/your/documents/**/*.md.

@ayazhafiz note in the example I just gave that you can handle multiple files with glob matching

from embedme.

ayazhafiz avatar ayazhafiz commented on June 16, 2024

Are you asking how to run this on a batch of files? If so, you can make a shell bash script. For instance, say you have a dependency to embedme in your package.json:

FILES="$(getfiles)"

echo $FILES | while read -r file; do
  yarn run embed "$file"
done

from embedme.

dgomesbr avatar dgomesbr commented on June 16, 2024

Hey @zakhenry,

I have a workshop with static pages in markdown, most of those pages include at least 1-3 code excerpts. embedme is great, because now I can keep it outside my MD files and make sure I can compile then to see if there's any error due to library being bumped after updates.

My question is, on my package.json I use the following:

"scripts": {
        "build": "tsc && (cd ../workshop && hugo)",
        "watch": "tsc -w",
        "deploy": "npm run build && cdk deploy",
        "cdk": "cdk"
    },

Now what step should I add there, just npx embedme path/1/**/*.md and so on?

from embedme.

zakhenry avatar zakhenry commented on June 16, 2024

@dgomesbr yep that's exactly right, you'd do something along the lines of

    "scripts": {
        "build": "tsc && embedme **/*.md && (cd ../workshop && hugo)",
    },

Note if you're using a package.json it is recommended to just install embedme as a normal package rather than using npx. All you have to do is run npm install embedme --save-dev

from embedme.

dgomesbr avatar dgomesbr commented on June 16, 2024

Thanks!

from embedme.

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.