fb55 / fb55/cornet

Question: A simple trumped equivalent example

Open
#6 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
48
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Hello, thanks for write this library, it's small and easy to use.

Can you provide a trumpet example equivalent in order to modify a specific matched selector and write the output?

var trumpet = require('trumpet');
var tr = trumpet();
tr.pipe(process.stdout);
 
var ws = tr.select('tbody').createWriteStream();
ws.end('<tr><td>rawr</td></tr>');

var fs = require('fs');
fs.createReadStream(__dirname + '/html/table.html').pipe(tr);

Particularly, in my case, I want to rewrite some things from an original HTML, like convert image src into absolute URLs.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how cornet handles a CSS selector and compare it with the trumpet example using tbody and html/table.html. Document an equivalent example that rewrites a matched image src and writes the transformed HTML to stdout; done means the example is clear enough to reproduce the requested transformation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.