Skip to content
Utility for replacing elements by id within html files.
Go Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/ud
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
doc.go
go.mod
go.sum
html.go
html_test.go
illustration.gv
illustration.gv.svg
mkdist.sh
onchange.sh
qa_test.go

README.md

Build Status codecov

ud - Utility for replacing elements by id within html files.

Quick start

go get -u github.com/gregoryv/ud

Replace an element by id

echo "<em>new thing</em>" | ud -w -i "someid" -html index.html

which is same as

echo '<em id="someid">new thing</em>' | ud -w -html index.html

Note! when -i flag is not given -c has no effect, it will always replace the identified element.

Replace content of element by id use the -c flag

echo "<em>new thing</em>" | ud -w -c -i "someid" -html index.html

Primary usecase

The primary reason for this tool was to simply generate and update image maps within html when working with graphviz documents

dot -Tcmapx somegraph.dot | ud -w -html index.html

You can’t perform that action at this time.