Giter Club home page Giter Club logo

tushuyuehou / monolith Goto Github PK

View Code? Open in Web Editor NEW

This project forked from y2z/monolith

0.0 1.0 0.0 4.16 MB

如果你想保存某个网页到电脑上,可以试下这个开源项目,有别于普通页面的保存操作,monolith 会通过命令行一次性打包页面中所有 CSS,图片和 JavaScript 等资源,而后生成一个单独的 HTML5 文档,方便你更好的保存与分享

Home Page: https://crates.io/crates/monolith

License: Creative Commons Zero v1.0 Universal

JavaScript 0.05% Rust 98.58% CSS 0.07% Makefile 0.13% HTML 0.95% Dockerfile 0.22%

monolith's Introduction

monolith build status on GNU/Linux monolith build status on macOS monolith build status on Windows

 _____     ______________    __________      ___________________    ___
|     \   /              \  |          |    |                   |  |   |
|      \_/       __       \_|    __    |    |    ___     ___    |__|   |
|               |  |            |  |   |    |   |   |   |   |          |
|   |\     /|   |__|    _       |__|   |____|   |   |   |   |    __    |
|   | \___/ |          | \                      |   |   |   |   |  |   |
|___|       |__________|  \_____________________|   |___|   |___|  |___|

A data hoarder’s dream come true: bundle any web page into a single HTML file. You can finally replace that gazillion of open tabs with a gazillion of .html files stored somewhere on your precious little drive.

Unlike the conventional “Save page as”, monolith not only saves the target document, it embeds CSS, image, and JavaScript assets all at once, producing a single HTML5 document that is a joy to store and share.

If compared to saving websites with wget -mpk, this tool embeds all assets as data URLs and therefore lets browsers render the saved page exactly the way it was on the Internet, even when no network connection is available.


Installation

Using Cargo

cargo install monolith

Via Homebrew (macOS and GNU/Linux)

brew install monolith

Via MacPorts (macOS)

sudo port install monolith

Using Snapcraft (GNU/Linux)

snap install monolith

Using FreeBSD packages (FreeBSD)

pkg install monolith

Using FreeBSD ports (FreeBSD)

cd /usr/ports/www/monolith/
make install clean

Using pkgsrc (NetBSD, OpenBSD, Haiku, etc)

cd /usr/pkgsrc/www/monolith
make install clean
docker build -t Y2Z/monolith .
sudo install -b dist/run-in-container.sh /usr/local/bin/monolith

From source

Dependency: libssl

git clone https://github.com/Y2Z/monolith.git
cd monolith
make install

Using pre-built binaries (Windows, ARM-based devices, etc)

Every release contains pre-built binaries for Windows, GNU/Linux, as well as platforms with non-standard CPU architecture.


Usage

monolith https://lyrics.github.io/db/P/Portishead/Dummy/Roads/ -o portishead-roads-lyrics.html
cat index.html | monolith -aIiFfcMv -b https://original.site/ - > result.html

Options

  • -a: Exclude audio sources
  • -b: Use custom base URL
  • -c: Exclude CSS
  • -C: Save document using custom charset
  • -e: Ignore network errors
  • -f: Omit frames
  • -F: Exclude web fonts
  • -i: Remove images
  • -I: Isolate the document
  • -j: Exclude JavaScript
  • -k: Accept invalid X.509 (TLS) certificates
  • -M: Don't add timestamp and URL information
  • -n: Extract contents of NOSCRIPT elements
  • -o: Write output to file (use “-” for STDOUT)
  • -s: Be quiet
  • -t: Adjust network request timeout
  • -u: Provide custom User-Agent
  • -v: Exclude videos

Proxies

Please set https_proxy, http_proxy, and no_proxy environment variables.


Contributing

Please open an issue if something is wrong, that helps make this project better.


Related projects


License

To the extent possible under law, the author(s) have dedicated all copyright related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.


Keep in mind that monolith is not aware of your browser’s session

monolith's People

Contributors

alch-emi avatar rhysd avatar robatipoor avatar oliver-hanikel avatar chenrui333 avatar knidarkness avatar zfhrp6 avatar cbluth avatar herbygillot avatar liamwarfield avatar timoteostewart avatar matildepark avatar voila avatar

Watchers

James Cloos avatar

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.