Yes, I’m finally gearing towards the release of my html2text.php
successor, dubbed Markdownify. I’m using exessive testing and utilize the MDTest suite to find potential regressions etc. I’m really enjoying to program little CLI scripts with PHP, it just works like a charm.
Here’s an example of how my test suite currently looks like:
To the left is the original input (HTML), in the middle you find the generated Markdown and to the right HTML again - but now generated via PHP Markdown by Michel Fortin. The pretty colors mark changes between the two HTML versions. I use PEAR Text_Diff for this and a little of my own code. But since all of the existing diff engines for Text_Diff took ages for the Markdown Documentation (~400 lines afair), I wrote a Text_Diff engine which utilizes [shell_exec](http://www.php.net/shell_exec)()
and GNU diff. This is blazingly fast and works like a charm! You can get the source code over at pastebin.org. Also take a look on the feature request I made. Dunno if this was the correct place for that…
continue reading...
NOTE: This script is apparently against the licensing contract between universities and Springer, see: http://www.bib.hm.edu/aktuelles/news/newsdetail_9984.de.html
NOTE 2: I do not maintain this script anymore. Please look for an alternative.
Seems like quite some people are interested in my bash script for downloading ebooks from http://springerlink.com.
That script has some quirks, the greatest of all that it was written in bash which makes it kind of hard to implement new features. And one which was requested was support for books which span multiple pages on SpringerLink.
So here I present springer_download.py
- a Python rewrite which should handle all the old links and some more. This is the very first program I’ve written in Python. And since it has to run on the Zedat servers it’s limited to Python 2.4.x without any fancy shmancy additions (a pity, since I’d love to use urlgrabber or pycurl).
continue reading...
Hi there!
Today I want to abuse the fact, that my blog is aggregated on some planets, to bring a project of a friend of mine into the spotlight:
The Linux-Minidisc project
It’s a project to bring Read/Write access on mini discs to Linux. It consists of a CLI and a Qt Gui. All code is licensed under the GPL and can be accessed via Git.
To get a nice introduction about the project, read this excerpt from a recent Linux Journal edition: http://users.physik.fu-berlin.de/~glaubitz/minidisclj.pdf
The project itself has a wiki under the following address: https://wiki.physik.fu-berlin.de/linux-minidisc/doku.php
As every other FOSS project, Adrian and his fellow developers need more man power. Especially someone who can spruce up the Qt GUI is needed. Help them!
continue reading...
Hi there again! I’ve been silent again on my blog, but didn’t rest on development. In the one and a half months since the last digest, I started writing a PHP application This finally made me eat my own dog food :). It resulted in lots of polishing and quite a few bug fixes for the PHP plugin in KDevelop. Here’s a list of what I think are the notably changes since the last digest:
(Note: to view screenshots, go to the bottom of this article.)
- refactoring of parts of the Code Completion code, should already result in faster code under certain situations
- properly mark constants as “Kind: Constant” in the declaration tooltips
- offer argument hints for ctors during code completion in class init statements
- greatly improve the generate inline documentation of built-in PHP functions, classes, properties etc. pp.
- add documentation of public properties
- support aliased functions (thanks to Victor Grischenko for his patch)
- show more/all documentation, and not only the first paragraph
- fix type-lookup
- don’t get confused when a documentation file documents both, a method and a function (greatly improves e.g. MySQLi documentation)
- don’t offer “jump to declaration” for built-in PHP declarations
- add support for
list(...)
statement - cleanup code-completion list, esp. show the return type of functions in the prefix field, and not something a la “function ReturnType ($arg1, $arg2, …)”
- improve the code-completion for include/require statements
- add language constructs to code completion (e.g. class, while, foreach, print, …)
- show declaration tooltip for magic constants, showing their current value
- make functions, methods and classes case-insensitive, just like PHP handles them
- some performance improvements, especially in code completion and parsing of the generated file containing php-internal declarations
- lots of bug fixes, don’t want to iterate them all ;-)
continue reading...
So, after a period of silence I present you an unsorted list of features and bug fixes I did to the PHP plugin for KDevelop in the last few weeks:
added support for path autocompletion after require / include statements: This shares code with the Cpp plugin and it’s completion after #include. I plan to use this autocompletion eventually also for functions accepting filenames or paths. Think of fopen, file_get_contents etc. pp. So far only URLs that are covered by an open project can be completed. We will need support for custom include paths so we can support e.g. global PEAR or framework installations.
worked around a bug where the “schedule all project files for parsing” had no affect. Apaku is currently working on making some internal changes so I can remove the workaround and fix this properly. With this fixed/worked around you should retry the PHP plugin along with frameworks or similar to see how well it works. Just make sure to have the framework inside your project so it gets parsed.
continue reading...
Has been a time since I wrote the last update for PHP / webdevelopment related work in KDevelop4…
XDebug
First of all, Niko (nsams) is working diligently on the general debugger framework for KDevelop4. Of course gdb is still the main focus so far yet he always has his XDebug plugin (which is currently unusable) in mind. So expect some great debugging features once he’s done with the framework.
Remote Projects
Another thing I’ve not yet written about is a bunch of commits I did just after the Hackaton: Remote Projects! Yes, finally you can work directly on the server with KDevelop. I still have to make sure that the user does not try to open a remote cmake project (or similar), because that is of course not supported. Only the Generic Project Manager (basically a list of files in a dir) works. There’s for sure some things to polish, yet I’d like to see user feedback for that use-case at least.
Note : There is still some functionality missing in other areas, like creating a new remote project from a template etc.
continue reading...
Hello Planet KDE!
I want to give you a little insight on the current state of PHP support in KDevelop4:
Me and Nikolaus Sams (nsams) are working diligently on a plugin for PHP support in playground. It’s somewhat stable, i.e. we fix any crashes we stumble upon, but I would call it Alpha state at most. It may eat your babies so to speak. Yet I’m happy to say that at least one user is already using it for production (hi leinir ;-) ).
implemented PHP support
Well, here’s a (not complete) list of features that are already working. Though I have to warn you: no screenshots included ;-) It’s actually all very similar to the C++ screenies you can see on the web.
sematic highlighting
Let’s start with a feature that only very recently was added for PHP - semantic highlighting. Niko moved some language independent parts of the C++ plugin from KDevelop to KDevplatform and now PHP has the same code highlighting features as C++.
continue reading...
I’ve just released a second Markdownify Beta with better PHP 4 support and some other small bug fixes. You can download it from sourceforge.
continue reading...
Finally I’ve completed the Markdownify website. Also I’ve released the first beta, here the news text from SourceForge:
This is the first beta release of Markdownify - the HTML to Markdown converter for PHP.
It is very stable and should handle nearly all features of Markdown and Markdown Extra syntax. Missing are only two things:
- “Markdown inside block elements” for Markdownify Extra
These two things will be added before the first “stable” release. Additionally some performance improvements will hopefully be added.
You are encouraged to use this release in your web applications. Please let me know if you find any bugs. Also a code review by anyone would be very much appreciated!
Download it now
continue reading...
A few days ago I started a complete rewrite of html2text. It now uses a new htmlparser (also written by me) which should make the whole HTML cleanup process obsolete. The generic XML parser which is currently used dies on invalid XHTML, with my parser it should be possible do handle errors and parse HTML 4.01 documents without any regex magic beforehand.
You’ll hear more of this in about a week as I’ll be on vacation until the 24th.
continue reading...