Skip to content

Commit

Permalink
integrate PayPayl button into homepage
Browse files Browse the repository at this point in the history
--HG--
extra : transplant_source : %C6%22t%25q%7F%E0bl%B7Lm%90%08%3E%3E%EF%9D%10%C1
  • Loading branch information
scoder committed Dec 13, 2011
1 parent e814ea4 commit 8617c29
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 20 deletions.
17 changes: 10 additions & 7 deletions README.rst
Expand Up @@ -13,7 +13,7 @@ Support the project
------------------- -------------------


Most people who use lxml do so because they like using it. Most people who use lxml do so because they like using it.
If you like it, send us a flattr. If you want to show us that you like it, send us a flattr.


.. class:: center .. class:: center


Expand All @@ -23,7 +23,8 @@ If you like it, send us a flattr.


However, if you are using lxml for your work and feel like you should However, if you are using lxml for your work and feel like you should
give a bit of your own benefit back to support the project, consider give a bit of your own benefit back to support the project, consider
sending us money through PayPal. Please read the Legal Notice below. sending us money through PayPal. Please read the `Legal Notice`_ below.
Thank you for your support.


.. class:: center .. class:: center


Expand All @@ -33,8 +34,9 @@ sending us money through PayPal. Please read the Legal Notice below.


Note that Flattr keeps 10% of the money for itself, so do not send Note that Flattr keeps 10% of the money for itself, so do not send
any larger amounts through Flattr. Use PayPal for donations instead, any larger amounts through Flattr. Use PayPal for donations instead,
or contact `Stefan Behnel`_ for other ways to support the lxml project, or `contact Stefan Behnel`_ for other ways to support the lxml project,
as well as commercial support, customisations and trainings. as well as commercial consulting, customisations and trainings on lxml
and fast Python XML processing.




.. |Donate| image:: https://github.com/lxml/lxml/raw/master/doc/html/paypal_btn_donateCC_LG.gif .. |Donate| image:: https://github.com/lxml/lxml/raw/master/doc/html/paypal_btn_donateCC_LG.gif
Expand All @@ -47,9 +49,10 @@ as well as commercial support, customisations and trainings.
:height: 20 :height: 20
:alt: Flattr the lxml project :alt: Flattr the lxml project


.. _`Stefan Behnel`: http://consulting.behnel.de/ .. _`contact Stefan Behnel`: http://consulting.behnel.de/
.. _`doc/main.txt`: http://lxml.de/ .. _`doc/main.txt`: http://lxml.de/
.. _`INSTALL.txt`: http://lxml.de/installation.html .. _`INSTALL.txt`: http://lxml.de/installation.html
.. _`Legal Notice`: #legal-notice-for-donations




Legal Notice for Donations Legal Notice for Donations
Expand All @@ -61,8 +64,8 @@ a donation to the lxml project, you acknowledge that we have the
right to use the money you donate in any lawful way and for any right to use the money you donate in any lawful way and for any
lawful purpose we see fit and we are not obligated to disclose lawful purpose we see fit and we are not obligated to disclose
the way and purpose to any party unless required by applicable the way and purpose to any party unless required by applicable
law. Although lxml is free software, to our best knowledge the law. Although lxml is free software, to the best of our knowledge
lxml project does not have any tax exempt status. The lxml the lxml project does not have any tax exempt status. The lxml
project is neither a registered non-profit corporation nor a project is neither a registered non-profit corporation nor a
registered charity in any country. Your donation may or may not registered charity in any country. Your donation may or may not
be tax-deductible; please consult your tax advisor in this matter. be tax-deductible; please consult your tax advisor in this matter.
Expand Down
20 changes: 12 additions & 8 deletions doc/html/style.css
Expand Up @@ -39,10 +39,14 @@ div.footer {
font-size: 70%; font-size: 70%;
} }


.center {
text-align: center;
}

/*** TOC ***/ /*** TOC ***/


div.contents.topic ul { div.contents.topic ul {
margin-top: 0px; margin-top: 0;
} }


div.contents.topic ul > li { div.contents.topic ul > li {
Expand All @@ -58,8 +62,8 @@ div.contents.topic > p > a {


div.sidemenu { div.sidemenu {
position: absolute; position: absolute;
top: 0px; top: 0;
left: 0px; left: 0;
width: 26em; width: 26em;
font-size: 10px; font-size: 10px;
text-align: left; text-align: left;
Expand Down Expand Up @@ -102,7 +106,7 @@ div.sidemenu ul.menu.foreign li.menu:hover ul.submenu {
position: absolute; position: absolute;
border: groove #990000; border: groove #990000;
padding: 1ex 1ex 1ex 3ex; padding: 1ex 1ex 1ex 3ex;
margin-top: 0px; margin-top: 0;
margin-left: 4em; margin-left: 4em;
margin-right: -20em; margin-right: -20em;
color: #990000; color: #990000;
Expand Down Expand Up @@ -175,7 +179,7 @@ p {
/*margin: 0.5em 0em 1em 0em;*/ /*margin: 0.5em 0em 1em 0em;*/
text-align: justify; text-align: justify;
line-height: 1.5em; line-height: 1.5em;
margin: 0.5em 0em 0em 0em; margin: 0.5em 0 0 0;
} }


th.docinfo-name { th.docinfo-name {
Expand Down Expand Up @@ -207,7 +211,7 @@ ul {


ol { ol {
line-height: 1.5em; line-height: 1.5em;
margin-left: 0em; margin-left: 0;
} }


blockquote { blockquote {
Expand All @@ -226,8 +230,8 @@ div.eyecatcher, p.eyecatcher {


div.pagequote { div.pagequote {
position: absolute; position: absolute;
top: 0px; top: 0;
right: 0px; right: 0;
padding: 10px 10px 0 0; padding: 10px 10px 0 0;
text-align: right; text-align: right;
font-size: 80%; font-size: 80%;
Expand Down
3 changes: 0 additions & 3 deletions doc/main.txt
Expand Up @@ -39,9 +39,6 @@ from 2.4 to 3.2. See the introduction_ for more information about
background and goals of the lxml project. Some common questions are background and goals of the lxml project. Some common questions are
answered in the FAQ_. answered in the FAQ_.


For commercial consulting, trainings and customisations, please
`contact Stefan Behnel <http://consulting.behnel.de/>`_.

.. _libxml2: http://xmlsoft.org/ .. _libxml2: http://xmlsoft.org/
.. _libxslt: http://xmlsoft.org/XSLT/ .. _libxslt: http://xmlsoft.org/XSLT/


Expand Down
23 changes: 21 additions & 2 deletions doc/mkhtml.py
Expand Up @@ -106,11 +106,29 @@ def inject_flatter_button(tree):
'</p>' '</p>'
)) ))


def inject_donate_buttons(lxml_path, rst2html_script, tree):
command = ([sys.executable, rst2html_script]
+ RST2HTML_OPTIONS.split() + [os.path.join(lxml_path, 'README.rst')])
rst2html = subprocess.Popen(command, stdout=subprocess.PIPE)
stdout, _ = rst2html.communicate()
readme = fromstring(stdout)

intro_div = tree.xpath('h:body//h:div[@id = "introduction"][1]',
namespaces=htmlnsmap)[0]
support_div = readme.xpath('h:body//h:div[@id = "support-the-project"][1]',
namespaces=htmlnsmap)[0]
intro_div.append(support_div)

legal = readme.xpath('h:body//h:div[@id = "legal-notice-for-donations"][1]',
namespaces=htmlnsmap)[0]
last_div = tree.xpath('h:body//h:div//h:div', namespaces=htmlnsmap)[-1]
last_div.addnext(legal)

def rest2html(script, source_path, dest_path, stylesheet_url): def rest2html(script, source_path, dest_path, stylesheet_url):
command = ('%s %s %s --stylesheet=%s --link-stylesheet %s > %s' % command = ('%s %s %s --stylesheet=%s --link-stylesheet %s > %s' %
(sys.executable, script, RST2HTML_OPTIONS, (sys.executable, script, RST2HTML_OPTIONS,
stylesheet_url, source_path, dest_path)) stylesheet_url, source_path, dest_path))
os.system(command) subprocess.call(command, shell=True)


def publish(dirname, lxml_path, release): def publish(dirname, lxml_path, release):
if not os.path.exists(dirname): if not os.path.exists(dirname):
Expand Down Expand Up @@ -184,7 +202,8 @@ def publish(dirname, lxml_path, release):
SubElement(SubElement(menu[-1], 'li'), 'a', href='http://lxml.de/sitemap.html').text = 'Sitemap' SubElement(SubElement(menu[-1], 'li'), 'a', href='http://lxml.de/sitemap.html').text = 'Sitemap'


# inject flattr button # inject flattr button
inject_flatter_button(trees['main.txt'][0]) #inject_flatter_button(trees['main.txt'][0])
inject_donate_buttons(lxml_path, script, trees['main.txt'][0])


# integrate menu into web pages # integrate menu into web pages
for tree, basename, outpath in trees.itervalues(): for tree, basename, outpath in trees.itervalues():
Expand Down

0 comments on commit 8617c29

Please sign in to comment.