We built a developer portal for iText that helps them to republish questions, answers, and code samples from Stackoverflow in their documentation. The same Drupal site also has an export function that packages the markdown content from the questions in a format that can be published on LeanPub, where it becomes available as a PDF, EPUB or MOBI document.
Stackoverflow is a great content marketing channel for developer evangelists. iText, the company that created the eponymous PDF library, has used Stackoverflow with great success to gain a strong reputation with developers and to build a sustainable business around their open source software.
In this blogpost we want to share how Bruno Lowagie (the original developer of iText) designed a workflow that allows him to publish questions and answers from Stackoverflow on the iText Drupal site and then export them to LeanPub (utilizing a custom Drupal module):
- A user posts a question on Stackoverflow, such as “Can’t get Czech characters while generating a PDF”:
- To answer this question, we create a standalone example. The finished sample code is then uploaded to GitLab, the open source code repository that iText uses to manage their project’s source code and example files.
- Then - when publishing the example Java file into the Examples section of the iText developers website (as a book node) - we use a custom Drupal module to link to the sample code file in GitLab and display the contents of that file within the node.
- Having all the elements in place, we answer the question in Stackoverflow - referring to the example with some information and a link to the source code and the resulting PDFs.
- Afterwards, we post the example - containing the code written when answering the Stackoverflow question - into the Q&A section of the iText developers website.
- In addition to the content now being accessible through the Q&A and Examples sections of the iText developers website (as well as in the original Stackoverflow post), we are also able to export the structured book content into the format (a ZIP file) required for publishing on LeanPub - utilizing a custom Drupal module developed to handle the Leanpub-specific format: Contents of LeanPub-specific book export from Drupal:
- Next, we are able to take the LeanPub-specific contents of the exported Drupal book and publish them on LeanPub:
See also Bruno Lowagie's video tutorial: