📜 ⬆️ ⬇️

Notes tagged with XML, HTML and Javascript

UPD ( 01/04/2009 ): Google Code Project - jsTagNotes .
UPD ( 06/03/2009 ): The project was finalized and moved to GitHub ( wiki ).

I want to describe that personally invented "bicycle", which I use to save notes, links to websites and other rather important information of small volume. To some extent, this is an alternative to web services such as del.icio.us and traditional desktop note-taking applications.

Screenshot

Ultimately, the goal of this post is to find out if it is worth sharing my project with public access. Well, to accept the comments to the implementation, I'm still far from the scope of web development.
')

Description of work


Notes are stored in an XML file. Add and edit notes by hand. It is not difficult to invent for this utility with a graphical interface, there would be a desire. I'm still quite happy with editing XML.

After editing a note or adding a new one, I run a self-written Python script that converts XML into a single HTML page using the lxml library. To simplify the code, I used the Mako template engine.

UPD ( 01/03/2009 ): Support for XSLT transformations is built into all modern browsers, so I wrote the XSLT stylesheet on the advice of the habiman tenshi . Now the XML file can be opened immediately in the browser.

XML, Python, and XSLT could be excluded from the system, implementing the editing of notes directly on the page using JavaScript. Ways to save changes to the DOM are known. Worth a look, say, on the Tiddly Wiki . However, the amount of code required for editing and saving notes on JavaScript depresses me.

You can limit yourself to half measures, eliminating only Python and XSLT, and implementing the conversion from XML (or whatever it will be more convenient and more efficient to use) in HTML in JavaScript. But the benefits of this, I think, do not justify the increase in the delay time when opening the page.

To navigate the notes on the page tags are used. I implemented the filter by tags as best I could in JavaScript, and made it possible to filter by several tags. In the tag cloud, you can view the most popular tags, and all at once. All this is not without the help of the JavaScript library, which I chose jQuery for . I carry the library with me, but I don’t connect it from the official site, so that I could view my notes in the absence of an Internet connection.

The most significant flaw in my system is performance. To build a tag cloud when you open the page takes more than a second. JavaScript optimization suggestions are accepted in this thread .

It is possible that sooner or later the number of notes will grow so that you have to fasten and paginate. Apparently, this will also have to be implemented in JavaScript.

UPD ( 01/03/2009 ): Brought the text in line with the current state of affairs.

Source: https://habr.com/ru/post/43746/


All Articles