Mailing List Archive

Has anyone archived a Trac project to PDFs?
Hello all,

We are tidying up in preparation for a server move and would like to take some old projects offline. However we need to keep the data accessible just in case, so I was thinking we could dump tickets and wiki pages to PDF files and use folders to maintain structure.

Has anyone done anything like this? Any python scripts etc that make crawling a trac project and printing to PDF less painful?

Any better suggestions?


Many thanks,

~ Mark Cooke

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/AM7PR05MB6851BA00A001ED0201A9A9C8BE760%40AM7PR05MB6851.eurprd05.prod.outlook.com.
Re: Has anyone archived a Trac project to PDFs? [ In reply to ]
On Thu, Jul 23, 2020 at 12:14 AM Cooke, Mark <
mark.cooke@siemens-healthineers.com> wrote:

> Hello all,
>
> We are tidying up in preparation for a server move and would like to take
> some old projects offline. However we need to keep the data accessible
> just in case, so I was thinking we could dump tickets and wiki pages to PDF
> files and use folders to maintain structure.
>
> Has anyone done anything like this? Any python scripts etc that make
> crawling a trac project and printing to PDF less painful?
>
> Any better suggestions?
>
>
> Many thanks,
>
> ~ Mark Cooke


You could "wiki dump" and have plain text files that could be parsed to
convert to a different flavor markup, or rendered to HTML using Trac's
tools.
https://trac.edgewall.org/wiki/TracAdmin#FullCommandReference

IIRC, the PDF plugins generate HTML and then feed the HTML pages to PDF
tools. The same could be scripted. For example, see the script that
converts wiki pages to ReST:
https://trac.edgewall.org/browser/trunk/contrib/wiki2rst.py

It uses PyPandoc, which is worth a look:
https://pypi.org/project/pypandoc/

- Ryan

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CA%2BBGpn8yxYB0PeGANAq1A_zBV%2BLz%3D9h0bWFcWrVoEuArFsPWXQ%40mail.gmail.com.
Re: Has anyone archived a Trac project to PDFs? [ In reply to ]
Hi Mark,

On Thursday, July 23, 2020 at 9:14:18 AM UTC+2, Cooke, Mark wrote:
>
> Hello all,
>
> We are tidying up in preparation for a server move and would like to take
> some old projects offline. However we need to keep the data accessible
> just in case, so I was thinking we could dump tickets and wiki pages to PDF
> files and use folders to maintain structure.
>
> Has anyone done anything like this? Any python scripts etc that make
> crawling a trac project and printing to PDF less painful?
>
> Any better suggestions?
>
>
> Many thanks,
>
> ~ Mark Cooke
>

i dont know what you need but wouldnt it be easier to keep the tickets as
html? I mean you could easily write some python code that saves the ticket
page as html, store it in your folder and be done with it.

for wiki pages, if you got it in restructured Text already sphinx is also a
tool that can create pdf out of restuctured text, so at least wiki pages
should be easy to generate.

but thats just top of my head here, I dont really need to do this kind of
thing, at the end you can always migrate the projects to a vm that you can
fire up if needed :-P but thius might be overkill for what you want to get
out of your trac projects.

cheers

Markus


--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/a1f3bb8a-2354-4543-9b01-598428eebac9o%40googlegroups.com.
Re: Has anyone archived a Trac project to PDFs? [ In reply to ]
Hi again Mark,

you might want to check out pdfkit

https://github.com/JazzCore/python-pdfkit

if you tinker abit that you get your auth going before using pdfkit , it
might be what you need. pdfkid has an option to generate pdf from an url
but as i said you might need to overcome the auth first.
There is an option parameter that can hold some infos, maybe Ryan can point
you in the right direction there (what to pass to the options so htdigest
or htaccess works)

cheers

MArkus

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/600a8cdc-0dbe-4e40-ac76-b5ebd179ffb9o%40googlegroups.com.
RE: Re: Has anyone archived a Trac project to PDFs? [ In reply to ]
> From: trac-users@googlegroups.com On Behalf Of Markus Rosjat
> Sent: 23 July 2020 09:27
> To: Trac Users <trac-users@googlegroups.com>
> Subject: [Trac] Re: Has anyone archived a Trac project to PDFs?
>
> Hi again Mark,
>
> you might want to check out pdfkit
>
> https://github.com/JazzCore/python-pdfkit
>
>
> if you tinker abit that you get your auth going before using pdfkit , it might
> be what you need. pdfkid has an option to generate pdf from an url but as i said
> you might need to overcome the auth first.
> There is an option parameter that can hold some infos, maybe Ryan can point you
> in the right direction there (what to pass to the options so htdigest or
> htaccess works)
>
> cheers
>
> MArkus

Thanks to Markus and Ryan for your responses, I will investigate further...

~ Mark C

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/AM7PR05MB6851638F96427891F10051DCBE760%40AM7PR05MB6851.eurprd05.prod.outlook.com.
Re: Has anyone archived a Trac project to PDFs? [ In reply to ]
Hi mark,

this could be the most basic way to get a ticket in a pdf with pdfkit. it
wont really get the formatting done in this iteration of code since you
need to figure out how to get all the links resolved in the request text
but if would generate the html.

import pdfkit as pdf
from requests.auth import HTTPDigestAuth
import requests


with requests.Session() as s:
s.get("http://your.tac.server/your_trac_project/login",auth=
HTTPDigestAuth('your_username', 'your_password'))
r = s.get("http://your.tac.server/your_trac_project/ticket/2/")
pdf.from_string(r.text,"name_of_your_pdf.pdf")

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/f505dd59-1d37-4b23-acbd-59a3fae5533ao%40googlegroups.com.