Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced PyQuery with BeautifulSoup4 and lxml. #52

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ nosetests.xml
.mr.developer.cfg
.project
.pydevproject

.DS_Store
50 changes: 40 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,53 @@ Start with a clean, no commits Github repository.

Warning! This project is a hack. It's not official. But it works for me.

The interface
-------------
The interface commands
----------------------

``setup [--gh-repo=<repo-url>]``
``setup [--path output/dir] repository``

      Creates a GIT repository inside ``static/`` directory.
      Creates a GIT repository inside ``--path`` directory.

``generate [--domain=<local-address>]``
``generate [--path output/dir] (--replace-all | --replace-tags) [source-url] [target-url]``

      Generates static pages from locally running Ghost instance.
``--replace-all`` substitutes all ``source-url`` instances with value of ``target-url``

``preview``
``preview [--path [output/dir]]``

      Preview what's generated on ``localhost:9000``.

``deploy``
``deploy [--path [output/dir]]``

      Commits and deploys changes static files to Github repository.

``add-domain <domain-name>``
``add-domain [--path [output/dir]] target-domain``

      Adds CNAME file with custom domain name as required by Github
Pages.

``buster command -h``
      Outputs additional usage information for a command

``buster -h``
      Outputs top-level help

``buster -v``
      Prints the current buster version.

Buster assumes you have ``static/`` folder in your current directory (or
creates one during ``setup`` command). You can specify custom directory
path using ``[--dir=<path>]`` option to any of the above commands.

The ``[--replace-all=<true|false>]`` option switches between replacing
all urls buster can find, or only ``href`` attributes in ``a`` tags.

The ``[--target=<remote-address>]`` option let's you choose the target
domain and root directory of the generated site. This is especially
needed for the RSS/Atom feed that would otherwise point to ``--domain``.
The option provides an alternative to changing your blog URL in Ghost's
config.js (see below).

Don't forget to change your blog URL in config.js in Ghost.


Expand All @@ -64,10 +83,19 @@ Requirements
The following python packages would be installed automatically when
installed via ``pip``:

- `docopt <https://github.com/docopt/docopt>`__: Creates beautiful
command line interfaces *easily*.
- `argparse <https://docs.python.org/2/library/argparse.html>`__: Creates
powerful, functional command line interfaces.
- `GitPython <https://github.com/gitpython-developers/GitPython>`__:
Python interface for GIT.
`BeautifulSoup4 <http://www.crummy.com/software/BeautifulSoup/>`__:
Painlessly parses and creates (x)HTML(5)
`lxml <https://github.com/lxml/lxml/>`__: XML/HTML processor.

Example
_______

Generate a static version of your ghost blog with all links replaces via
``buster generate http://localhost:2368 https://foo.com --path /output/dir --replace-all``

Ghost. What?
------------
Expand Down Expand Up @@ -102,3 +130,5 @@ new one. Pull requests welcome!

*Made with* `jugaad <http://en.wikipedia.org/wiki/Jugaad>`__ *in*
`Dilli <http://en.wikipedia.org/wiki/Delhi>`__.

*Powered by ectoplasm.*
2 changes: 1 addition & 1 deletion buster/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = (0, 1, 3)
__version_info__ = (0, 1, 3, "bs4",3)
__version__ = '.'.join(map(str, __version_info__))
Loading