Developer up to 2.0: Alexander Yackovlev
Developer up to 2.0: Dmitry Poplavsky
Developer: Eric Laffoon
Developer: András Mantia
Copyright © 2002 Robert C. Nickel
Quanta is a markup and scripting language IDE that strives to be DTD agnostic, supporting web based markup and scripting languages.
It is hoped that Quanta will be easily extensible for uses we cannot imagine at this writing.
Table of Contents
From http://quanta.sourceforge.net/:
Quanta is a web development tool for the K Desktop Environment. Quanta is designed for quick web development and is rapidly becoming a mature editor with a number of great features. Our objective remains to create the very best web development tool anywhere. We realize that we will need many more people active to accomplish this so we are in the process of developing enhancements geared toward making it easy for web developers to customize, extend and enhance Quanta. Then we will be asking you, the web developers, to contribute your feature enhancements. We will organize these so that Quanta web developers can find just the resources, extensions and custom plugins they need to be the most kick butt developers ever. | ||
--Eric Lafoon |
Doesn't it just bring a tear to your eyes?
This chapter describes obtaining and building Quanta.
Many linux distros are bundling Quanta. Please check your favorite vendors site for a package tailored to your distro. If that fails, see Linux Easy for a RedHat oriented rpm of the latest cvs source.
Release versions of the Quanta source code can be obtained from the SourceForge home page. Once downloaded, simply unpack it into a directory and then go to Building the source to finish.
If you have to have access to the very latest features (and potentially, bugs), you can obtain Quanta via anonymous CVS with the following:
%cvs -d:pserver:anonymous@anoncvs.kde.org:/home/kde login CVS login:<enter> %cvs -d:pserver:anonymous@anoncvs.kde.org:/home/kde co quanta
A short download later, you should have a quanta directory under your current working directory.
To finish things up, cd to the quanta/admin directory and type:
%cvs update -P -C -d -R -r KDE_3_0_BASE
A short while later, all these files will be updated. One last bit before we can build the source.
%make -f Makefile.cvs
This creates a number of files necessary to build the source. From here go to Building the source to finish.
If you acquired Quanta source from CVS, be sure to read this.
Quanta uses automake and autoconf to ease installation from source. If you're familiar with these, skip to Quanta build considerations, otherwise, please read the following.
To install quanta you need KDE 3 and Qt 3.0.x, and run:
%test `echo $KDEDIR` && echo "KDEDIR ok" || echo "KDEDIR not exported" %test `echo $QTDIR` && echo "QTDIR ok" || echo "QTDIR not exported" a b
If these don't return KDEDIR ok and QTDIR ok, you need to set them permanently or in a script that you call to execute Quanta and before you continue with the build process.
Once these are verified to be set, run the following:
%./configure %make %make install (as root) ... *************** Important ************************* Add path-to-kde3-bin-directory to your PATH Please report bugs with our web form at http://bugs.kde.org Crediting original team members Alexander Yakovlev <yshurik@kde.org> Dmitry Poplavsky <dima@kde.org> Current maintainers are Eric Laffoon <sequitur@kde.org> Andras Mantia <amantia@freemail.hu> The Quanta developers wish you fun with Quanta. ****************************************************
It's reasonable that you would want to customize the location of the Quanta files on your system. To this end, autoconf has a number of options that can be passed to the configure script to control this setup. To get a complete listing of these options, type ./configure --help. These are straight forward and will not be covered here.
If you're having trouble with Quanta running properly, you should check your path to ensure that the kde3 bin directory is in there. Also, be sure that you don't have any older versions of KDE laying about that appear in %PATH before your kde3 bin directory. The same holds true for Qt.
While striving to become the best HTML editor, the developers of Quanta began to kick about a rather intruiging idea. “What if Quanta was a generic, extensible, markup language editor?”
Well, this is the start of the answer. No longer bound to HTML, Quanta is now well on its way to becoming DTD agnostic. Essentially, if you can define it in XML or SGML, Quanta should be able to serve as an IDE for it.
Now, that said, it must be noted that Quanta is an outgrowth of the outstanding efforts that have been put forth by the entire KDE development community. Quanta, in celebration of open source uses the model of “Why rewrite something somebody already did and maintains already?”
Quanta provides web developers with an intuitive and powerful multiple document interface MDI that can dramatically increase your effectiveness as a web developer. Through the use of custom actions, scripting and toolbar creation you can automate almost any task. With the use of Kaptain, you can extend Quanta, so that you never have to remember scripting command syntax again (More on that in the Advanced Features section.).
Quanta divides workspace files into three areas; Global, Local and Project. These distinctions affect the scope or visibility of the various components in the Quanta IDE.
Global items are available to anyone who uses Quanta. From toolbars to actions, everything marked as global is stored in the common Quanta directory structure. This has the effect of allowing a group of admins to save certain toolbars, actions and templates in the global tree that can then be used to keep a multi-user installation of Quanta common to everyone on the system.
Local items are items that are part of an individual users collection of resources. These are stored in the individual users home directory tree as part of the kde environment information. This exposes all of the items stored as Local for use in any editing that the individual user wishes to work on. This allows you to save your most useful templates and toolbars into your home directory and use them on any documents.
Project items are those items that are of use only to a particular project. These could be anything from a CSS template to a toolbar with a custom action that performs a special magic trick on this project's files. Simply put, this is the most limited scope. All of the items saved in the project workspace be saved in the project's directory tree.
Quanta's editor window
At the top of the editor window is the editor toolbar set. Currently, Quanta has a default set of toolbars that are loaded. These are Standard, Fonts, Tables, Lists, Forms, Other. These are the original toolbars that have been a part of Quanta for some time now. These toolbars are strictly HTML and will continue to be a part of Quanta but will eventually be loaded only on demand and not by default.
Toolbar usage is pretty straight forward. If you're looking for a basic tag (like <u>), you click on that tag and it is inserted into your document. You then insert your information betrween (if there's a closing tag) the tags and call it good. If you're looking to insert something that takes more information than just you're text (like a <a href...>) then you'll get a dialog box with the various fields you can fill in.
HTML toolbar anchor dialog
Quanta's tree view window
The tree view is the place where you will navigate and gather information in Quanta. It's tabbed format presents you with a Files, Project, Template, Document Structure and Documentation Tree.
Tabs in the tree view
A major portion of Quanta's push to be DTD agnostic is dependent upon ease of use for each separate DTD. To that end, the toolbars in Quanta have been extended a great deal. Toolbars are easy enough to understand. You click onthe button and you get an associated action from that button. The really cool part here is that you can define your own actions in Quanta.
Using toolbars in Quanta is incredibly simple. Selecting the Toolbars (Alt+l) menu item reveals options to load, save, add and email toolbars.
Loading and saving toolbars is pretty straight forward. When you choose to load a toolbar, you may choose from one of the three workspaces in Quanta.
One of the most exciting new features of Quanta toolbars is that you can email them directly from Quanta. When you do so, Quanta bundles all of the actions and the toolbar information into a zipped tar archive then pushes it out via KMail. Once you receive a toolbar in email, you can save it anywhere and load it into Quanta like any other toolbar!
As previously mentioned, toolbars in Quanta are primarily maanged through the Toolbars menu item. Usability and creation are somewhat different. Creation is deferred to an as there is more involved there. Usability will be discussed now.
Using toolbars is quite simple. You click on the icon of the desired tag or and one of three possibilities occur: the tag is inserted (optionally with a closing tag) (e.g. the bold HTML tag), a tag dialog is activated letting you fill in the multiple tag features in a dialog box (e.g. the anchor HTML tag), and lastly, an action is activated that does something nifty for your current file/project/whatever. For the first, I'll give no example as it is easy enough to understand. As to the second and third, read on...
Tag dialogs are defined in XML and stored in a tags subdirectory under your .kde subdirectory or with the Quanta distribution wherever you put that. I bring this up only to note that, if you find yourself doing tedious and redundant typing for a particular tag that isn't in Quanta, you can add it. Anyway, a tag dialog looks just like this:
This happens to be the anchor tag referenced above. If you know anything about HTML, you'll notice that that's just about all the attributes you can have for an anchor. Notice the tabs above for i18n and Events. Now all you do is fill in the blanks for those items you want in your anchor, click ok and, voila!, you have a well formed anchor set down at the current cursor position.
As for scripting actions, if you create two files in your home directory with the following contents, you'll have a fun surprise.
dt.actions
<!DOCTYPE actionsconfig> <actions> <action icon=“mini-book1.png” type=“script” name=“usr_1” \ text=“Shell” > <script output=“message” error=“message” \ input=“none” >xterm</script> </action> </actions>
dt.toolbar
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> <kpartgui name="quanta" version="2"> <ToolBar tabname="My1stToolbar" name="dt" > <text>My1stToolbar</text> <Action name="usr_1" /> </Toolbar> </kpartgui>
Some of the items listed in this section may be incorrect. If you find an error, please drop a line to <robert@artnickel.com> and let me know about it. Much of the menu tree was changed shortly after I wrote this section.
Create a new, blank file.
Search the filesystem to open an existing file. You can also use the kio slaves here to open up files from the network by placing the kio slave tag at the beginning of the url. (e.g. ftp://foo.bar.com/myfile.html)
Quick list of the last several files you've opened for ease of use. This list will change each time you open a file that is not on it, with the oldest being bumped off first.
Save the active file's changes.
Save the active file with another name.
This allows you to save code snippets and entire files as a template for later use. See the section on templates
Save all modified files in the editor.
A new feature in Quanta! You can actually print out your documents. Uses the kprinter interface.
Close the currently displayed file.
Close all open files. Prompting for save if modified, of course.
Exit Quanta
Undo the last action performed.
Redo the last action undone.
Cut the current block of text and place its contents on the clipboard.
Copy the current block of text to the clipboard.
Paste the contents of the clipboard at the current cursor position.
Converts the clipboard text HTML special characters to html entities before pasting into the text body so they show up properly when viewed and aren't picked up as tags by the client browser.
Select all of the text in the current document.
Unselect all text in the current document.
Turn on/off block highlighting. Allows you to select text blocks with your keyboard without holding down the shift key.
String or regular expression pattern to find in the current document.
Repeat the find downward in the document from the current location.
Repeat the find upward in the document from the current location.
String or regular expression replacement of text in the current file.
Find a string or expression in files in the selected directory. Sort of a gui grep or sed with some predefined pattern spaces to help you out.
Move the selected block of text one tab width to the right.
Move the selected block of text one tab width to the left.
Deprecated. HTML specific function that will be pulled soon. Don't get used to it as it's HTML comments and not DTD specific.
Deprecated. HTML specific function that will be pulled soon. Don't get used to it as it's HTML comments and not DTD specific.
Wrap the text in the current window to a predefined width.
Go directly to a specific line number. This is really helpful when your PHP script is barfing at you!
Check the spelling in the current document.
Toggle display of the files tree.
Toggle display of the project tree.
Toggle display of the template tree.
Toggle display of the document structure tree.
Toggle display of the documentation tree.
Preview the current document.
Navigate back one step in the preview.
Navigate forward one step in the preview after having gone back in the preview.
Reload the preview from disk.
View the current file with Netscape (Mozilla).
View the current file with Konqueror.
View the current file with Lynx (text based browser).
Toggle a bookmark at the current line location in the current file.
Clears all set bookmarks.
If you are looking for a description of how to use projects in Quanta, go here instead.
Launch the project creation wizard.
Open an existing project file from disk. Quanta projects are saved with the .webprj extension.
Gives you a list of your most recently used projects for quick access.
Save the current project to disk.
Close the current project.
Presents a dialog that allows you to select files to add to your current project. These files will then be copied into the project directory for editing.
Insert a directory and all of its contents into the current project.
Scan the project directory for any new files you may have there. This allows you to copy graphics into your project directory or a subdirectory thereof and then add them to the project.
Upload the files in your project to the hosting server. The list of available transports depends on the version of KDE you are running and whether or not you've downloaded extra kio slaves.
Settings affecting the way Quanta manages your project. See the Quanta projects section for details.
This menu contains a list of the tags that are on the currently loaded toolbars. i.e. If you have the Standard (HTML) toolbar loaded, the Tags menu will contain a submenu Standard which will contain the list of tags/actions on that toolbar. This is a pretty cool little keyboard navigation scheme that Andras came up with of a sudden one day.
Pops up a dialog box that allows you to change the current documents DTD (Document Type Defininition)
Allows you to access the current markup tag's settings dialog if one exists.
Checks the syntax of the current document against the selected DTD.
Loads a globally defined toolbar. These are kept in $KDEDIR/share/apps/quanta/toolbars by default.
Loads a locally defined toolbar. These are kept in $HOME/.kde/share/apps/quanta/toolbars by default.
Loads a project toolbar. These are kept in <ProjectDir>/toolbars and are only available in this menu if they have been assigned to this project.
Dialog for saving your toolbars. Allows you to pick the type of toolbar; Local or Project.
Save as a local toolbar to $HOME/.kde/share/apps/quanta/toolbars
Save as a project toolbar in <ProjectDir>/toolbars
Brings up a dialog to create a new toolbar. This only creates the name. Actions must be added from the Settings->Configure Actions menu item. Toolbars are saved via the Toolbars->Save Toolbars menu or on close unsaved toolbars will prompt for you to save.
Remove a toolbar from usage. This does not remove it from the disk. If you've not saved the toolbar you are removing, you will be prompted to save it.
This is a hook to email your custom toolbar to someone (maybe the Quanta team for inclusion in the next release!) for their use. It spawns an email window and attaches your toolbar file to it automagically.
Toggle display of the Quanta toolbar. This has no effect on the action toolbars.
Toggle display of the status bar along the bottom of the editor.
Toggle display of the message window. This is the window where you see the output of any scripting actions and the debugger.
Toggle display of the icon border to the left of the main editor window. This bar allows for click toggling of bookmarks.
Toggles the display of line numbers along the left side of the main editor window.
Setup the behavior of the editor window. See the documentation on Kate for details.
Setup the behavior of Quanta.
This is where you define the actions for use on toolbars. Please see the
Dialog that allows you to add/delete items to/from toolbars and change the order the icons appear in.
Allows you to configure the many editor shortcuts available to Quanta.
Choose the syntax highlighting mode for the current file. The list of available highlighting schemes varies depending on your version of Kate.
Select the end of line encoding type. Useful if you have folks using other OS platforms to develop on (shudder at the thought). Choose from Unix, Windows/DOS or Macintosh.
This gives a little question mark next to your pointer and allows clicking on an object for specific help. At the time of this writing this feature is not implemented.
This should produce help based on the current pointer context. At the time of this writing this feature is not implemented.
This gathers the operating environment for Quanta and produces a link to the kde bug wizard.
All about Quanta, it's authors and supporters. Also contains a copy of the software license that Quanta exists under.
Displays a popup window with information about your running kde, how to report bugs for kde, how to join the effort and more.
The Quanta project wizard ( Project->New Project) makes project creation a breeze.
The fields are pretty straight forward and are best filled in from top to bottom as filling in the project name will relieve you of some effort of typing in all the directory structure for the rest of the project. However, we're open source and will not limit your uses of this program. All of these paths and author information fields are configurable at this point and later from the Project->Project Options (F7) menu tree on the General Tab.
This is the name of your project. Whatever you wish to call it. For means of example, we'll call ours foo. As you type into this field you'll notice that the Project destination, source file, templates and toolbars fields all fill in with default values. All paths in this project will be set relative to the current users home directory where the destination directory will be set to $HOME/<Lower-Case-Project-Name-Without-Spaces> (e.g. $HOME/foo/ is the destination directory).
This is the directory where all of the project files will be stored. By default, this is $HOME/foo where foo is the name of your project in all lower case letters.
This is the name of the Quanta project file. By default it is the name of your project in lower case letters without whitespace with the webprj extension (e.g. foo.webprj). This file is stored in the root of the Project destination directory.
This is where the templates for this project will be stored. By default it is <Project destination>/templates. If you have a common set of files that you use for several projects, it may be useful to point this there instead of the default.
This is where the toolbars for this project will be stored. By default it is <Project destination>/toolbars. If you have a common set of toolbars that you use for several projects, it may be useful to point this there instead of the default.
Insert your name (or alias) here.
Email where you'd like things regarding this project to go. Hopefully, it belongs to you.
This allows you to get files from the local filesystem. You can choose multiple files or entire directories. Use of kio slaves is not allowed.
This option is great if you have static web content that you wish to download and modify. For server side scripting (a la PHP, Python, etc.) you'll have to get the files another way.
The last screen of the new project wizard has 3 settings that can make your life easier. These settings are avialable for change from the Project->Project Options (F7) menu tree on the Network Tab.
This allows you to set the path prefix to something other than your local filesystem. This is most useful for pages that contain dynamic content and are dependent on server processing (like PHP, JSS, Python, etc.). Simply type in the first portion of the address as it exists on that server and the filepath at the end will be complete by quanta. For example, if you have the domain bar.com and you're editng the index.html page, you could edit it on your remote machine (foo.bar.com), upload it to the server and press F6 to see the results from www.bar.com instead of your local filesystem.
This makes a copy of the global templates in your projects directory tree.
This makes a copy of the local templates in your projects directory tree.
By default Quanta will open the last project accessed when launched. This behavior is not currently configurable.
To open another project, select Open from the Project menu or the Open Project icon on the toolbar. The open project dialog will pop up and allow you to choose the project you wish. Projects have a webprj extension.
When closing Quanta, your project file will be saved automatically. You will be asked to save any changes before exiting if Quanta detects any changed files. This same behavior occurs if you load a new project.
The project tree view gives you uncluttered access to the files in your project. This is where you manage the files in the current project.
For files, a right mouse button (RMB) click brings up the following menu:
These items are fairly self-explanatory and will be left to the reader for exploration.
Directories are similar and are just missing the Open with and Open in Quanta RMB menu items:
These items are left to the reader for exploration as well.
The upload projects dialog:
This is the hostname of the server your copying the files to. Either fully qualified domain name, or an ip address will work.
Transfer protocol to use for this upload. Depending on your version of KDE and whether you've downloaded extra kio slaves, this list will vary. At the very least you should be able to choose from ftp, file and nfs.
This is the base path on the remote host that you will be copying files to.
Port for the transfer. Usually this won't need to be bothered unless your network administrator is hosting a service on a port other than it's well known port.
User name to use for authentication. If you're using Linux and I need to explain this to you, send me an email for your slap! ;-)
Depending on your level of paranoia, this is a good or bad feature. Use it at your discretion. FYI, the password is kept ??? and is clear text.
Select all files in your project for upload.
Select all modified files for upload.
Unselects all files in the list.
Duh! Beam 'em up Scotty.
This will abort your transfer in progress or just exit out of the dialog if you change your mind before starting the upload.
Templates are basically skeleton documents, code snippets and files to link to. Quanta uses templates fundementally as a standard file system with enhanced organization and interfacing. You can copy, move or link any repository currently on your system into the templates tree. Think of Quanta templates as having roughly the limitations to your imagination that your file system has.
Templates exist in nested directories. There is no limit to how deep you can nest them however within any given directory Quanta expects a consistent action for the base template type described below. Additionally templates allow for pre and post text to be concatonated to non document type templates. This facilitates tag creation. The next update after the introduction is scheduled to add the ability to pass variables to the text such as image size information to assist in tag creation.
Our goal with templates is to extend them to include multi file "concept" templates useful for things like placing an order or creating an about section, Ideally this will be a tool for making your work more productive and dynamic. An eventual goal is to have a structural template design mode to deal with site layout and structure which you could use to design and interactively update your sites. If you would like to be involved, check out our help wanted page.
Some of the templates that ship with Quanta have conditions for their usage. Please read carefully the usage statement of conditions at the top of each template before you use it.
Currently templates are limited to being one of the following types of objects:
Document |
Text to insert in a document |
A file to link to form a document |
Documents can be any type of document. Generally you would want to nest more specific or diverse documents in subdirectories. Here you can make a basic framework for what you do and deliver it to your work in an organized fashion and realize much better effiency. Text insertion could be anything from a snippet of code to a script or whatever you might wish to use. This overlaps the ability to insert text blocks as an action which can be triggered from the toolbar. Linked files can be binary, PHP class libraries or whatever.
Templates are accessible based upon their established workspace in Quanta
Create a document structure that you love (XML, HTML, DocBook, etc.) and click on File->Save as Template->Save as Local/Project Template.
Once this is done, you'll notice that (even if it's saved as a Project template) the template does NOT show in the project tab view. Look into the templates view to find your template under the Project templates tab.
Additinoally if you look at your options with the Right Mouse Button (RMB) you will see complete file management tools for creatind directories or copying and pasting templates from one location to another.
Project templates allow you to be more tightly focused. You can create headers, footers or go dynamic with PHP include files and link them. Additionally there are some very cool things we took into consideration when using templates in projects.
When creating a project you can opt to copy over all global and user templates. Legacy project get default templating abilities so nothing is lost You can choose where to locate your template files so they can be in your server root and easy to upload or you can make them secure to link to below server root which is a very cool trick When linking to a file not in the project templates you will be prompted to copy the file to the project templates prior to linking. This will prevent broken links on upload. You always have control where you place your templates so you can choose to move them. However Quanta does not track this so you will need to change links. This is a good task for kfilereplace which we are setting up to plug in as a kpart.
Template structure on the template tab is based on the files found in $KDEDIR/share/apps/quanta/templates and $HOME/.kde/share/apps/quanta/templates. Each of these directories is specified as one of three types of container:
binaries and such things that get inserted by their url (ie images as an <img src=/src/url>
text that you can insert into the current quanta document. stuff like repetitive blocks etc
document templates which you can create new documents from. these open a new window in quanta.
To set the behavior of each directory, righ-click in the template view on the directory and choose proerties. The folowing dialog will come up:
Drop down box with the three types discussed prefiously; files, text, template. This box will be grayed out if you have the inheret parent attribute box checked.
This is checked by default and is fine for all but the top level directories in your templates tree. If the top level directory has this checked, it will basically deactivate templates for that directory and all that aren't explicitly set below it. If this is not a top level directory, then the <blah> will say something like text/all. If it says nothing, then chances are that you're on a top level directory.
Enables pre and post text for templates in this directory. This could be a common header/footer for all of your templates for a given project and then you copy content templates into that directory and have a complete page with the custom header/footer as a starting point.
The actual text to insert before your templates content.
The actual text to insert after your templates content.
This chapter outlines the advanced features of Quanta.
Quanta uses tag files to define the various actions that are available for toolbar association. These tag files can define a simple tag with no attributes or they can define a tag dialog box that will remember all of the available attributes for you so that you can simply fill in the blanks.
Spaces don't adversely affect anything, but watch out for & and < characters. These should likely be replaced by & and < respectively in all of the xml based Quanta resource files. This won't cause a crash, but you'll have chunks of your work disappear if you forget.
Possible entries for the type attribute of the attr tag: To get a list of possible types, I did the following against the tag dirs: grep -h type= *.tag |sed -e 's/^.*type=\"\([a-z]*\).*/\1/'| sort |uniq
These are the types for tag dialog items:
check |
color |
input |
list |
text |
url |
These are the argument types inside the php function tags, ask Andras if these are pretty much free form and the former are keywords:
array |
bool |
boolean |
char |
constant |
flags |
float |
function |
int |
long |
mixed |
number |
object |
resource |
resoure |
string |
The tag definition has the following optional attributes:
"1" if common events/scripts can be associated to this tag (onclick etc.)
"1" if common core attributes are present (id, class, etc)
"1" if common i18n attributes are present (lang, dir)
"1" if it is a single tag (eg. <hr>)
"1" if it is an optional tag (eg. <colgroup>)
for scripting languages, the function return type if any. (eg int)
The <attr> definition can have the following attributes:
the default value of the tag ???
can be “optional”, “required”, “implied”
For scripting language functions, define tag files as such:
<!DOCTYPE tags>
<tags>
<tag name=“[function-name]” type=“function” returnType=“[return-type]”>
<attr name=“[argument1]>” type=“[argument1-type]”></attr>
<attr name=“[argument2]” type=“[argument2-type]” status=“optional”></attr>
...
</tag>
<tag ...
...
</tag>
...
</tags>
Items in [] are to be substituted. argument1 above is required and argument2 is optional.
A tag file that you want to have tag dialog editing of should look like this:
<!DOCTYPE tags> <tags> <tag name="[name] [hasCore="[01]" hasI18n="[01]" hasScript="[01]"]> <attr name="[attribute1]" type="[check|color|input|list|text|url]"> <text></text> <textlocation col="0" row="0" /> <tooltip></tooltip> <location col="1" row="0" colspan="3"/> </attr> ... </tag> ... </tags>
<text></text> defines brief descriptive text for the object.
<textlocation ... /> defines row and column layout for <text> tag.
<tooltip></tooltip> is text description for a hovering user.
<location ../> defines the location of the object for that attribute.
All the attributes must be enumarated in the tag file. If you don't want to appear in the tagdialog, just forget the <location> tag. eg <attr ...> </attr>
This chapter describes how to customize Quanta to your particular needs and how you can help Quanta become better.
Probably the most notable additions to Quanta for the general user will be the addition of documentation for the markup or scripting language that you like best. To that end, this chapter will explain how I create the php documentation tree for my personal use.
Before starting on creating your own documentation, you may wish to check out the Quanta repository to see if someone else has already done this set.
There are two parts to this process. First, you must obtain the existing documentation for the markup/scripting/etc language that you're after. Second, you have to create the docrc file. The first is up to you, the second is what we'll cover here.
The general form of the docrc file is as follows:
#KDE Config File
[Tree]
Doc dir=<path, relative to this file, of the documentation html files> e.g. php42/
#top level elements
Top Element=<Your description for these docs> e.g. PHP 4.2 documentation
Section 1=Section1.html
Section 2=#Sec2.1,#Sec2.2,#Sec2.3
Sec2.1=Sec2.1.html
Sec2.2=Sec2.2.html
Sec2.3=Sec2.3.html
...
[Context]
ContextList=func1,func2,tag1,tag2,tag3
func1=func1.html
func2=func2.html
tag1=tag1.html
tag2=tag2.html
tag3=tag3.html
The Tree section defines the presentation aspect of the documentation in the documentation tab. For example, you'll see that in the php docs you have something akin to this:
Relating this to the above, my php docrc looks like this:
#KDE Config File
[Tree]
Doc dir=php42/
#top level elements
Top Element=PHP 4.2 documentation
PHP 4.2 documentation=Table of Contents,#Getting Started,#Language Reference
Table of Contents=index.html
Getting Started=Introduction, ...
Introduction=introduction.html
...
Language Reference=Basic syntax, ...
Basic syntax=language.basic-syntax.html
...
For the Table of Contents, you'll notice that it is referenced directly to a file (and consequently shows up at the bottom of the tree view - directories first!).
Spaces don't adversely affect anything, but watch out for & and < characters. These should likely be replaced by & and < respectively in all of the xml based Quanta resource files.
The Context section is the section of the docrc file that is used to facilitate context sensitive help. For example, you're writing a PHP script and you'd like to see the docs for the mysql_fetch_array function. You simply highlight the function and then press (Ctrl+H) for context help. Woosh! You're viewing the docs on mysql_fetch_array. There are only two entry types here: the ContextList and the file association lines.
Really simple, this is just a comma separated list of the context items you wish to have available (for PHP, these are the functions for PHP).
These are of the form context item=html doc page. e.g. acos=function.acos.html
#Keywords for context help
[Context]
ContextList=abs,acos,acosh,addcslashes,addslashes,...
abs=function.abs.html
acos=function.acos.html
acosh=function.acosh.html
addcslashes=function.addcslashes.html
addslashes=function.addslashes.html
...
Now you can just save your docrc file, save it in $HOME/.kde/share/apps/quanta/doc or $KDEDIR/share/apps/quatna/doc for local or global use respectively. Then create a directory (the one specified in your docrc file) in the same directory as your docrc file and copy your html doc pages in there.
You'll need to restart Quanta and then you'll see your docs.
Once you're sure that they're good and worth sharing, send the docrc file along with a description of any pertinent information on what docs you used to the Quanta repository for use by the Quanta community. You won't get rich, but you'll feel great knowing that you contributed to the best web development platform around.
Actions in Quanta are the basis for nearly all the extensions that Quanta has and will acquire in the future. The same mechanism that defines an action in Quanta enables autocompletion and tag dialogs. With actions, the limit of what you can do is virtually limitless. For means of an example, we will use html tidy on our web pages.
Let's get started: Settings->Configure Actions
Once you start the actions dialog you'll see this window. To the left is the list of currently known actions. You can select one of those and perform the same actions for an existing action that we're going to do with our html tidy action.
We're going to make a new action, so let's click on the new button (lower left) and begin.
Now you're presented with a blank set of options to fill in:
This is the name of the action
Not sure where this get's displayed. It's optional!
Don't know what this is for or where it's used. It's optional!
This enables the drop down box for selection of a toolbar to place this action onto. If you don't choose now, you can always add them later from Settings->Configure Toolbars.
Now to the meat of the matter. The actions definition.
If we were defining a markup tag, we could use the tag tab here to input the tags parameters.
To whit:
This is where you enter the tag name as it will appear in your document. e.g. <div align=center>
This is where you enter the closing tag, if any, or uncheck the box if none. e.g. </div>
This runs the dialog editor if there is a tag file defined for this item. Check out the tag files section for more information on tag files.
And now... Back to our regularly scheduled program. Continuing on the html tidy action creation.
Click on the Script tab to reveal the following:
This is where you place the executable that you're after. In our case, it would be /usr/local/bin/tidy because that's where I keep tidy.
Now on to the Input/Output/Error tabs.
Input Tab
Don't take any input for this script. This could be useful if you were calling a Tcl/Tk script that popped up a window for interaction with the user and then returned its results. We'll be choosing something else for tidy.
Just what it says. It pushes a copy of the currently selected text out to the standard in of the script in the input box above. We could use this for tidy, but it's no fun to select everything in a large document.
Pipes the contents of the editor version of the file through to the standard in of the script in the input box above. This is what we'll use for tidy.
Now click on the Output tab. This is where we decide on our redirection for your scripts output.
Duh. This would be fine if you're launching an external application that only takes input but doesn't output anything. This is no real use for us with tidy.
Just what it says. Be certain you're where you want the text inserted. No good for tidy.
Total file replacement here. It won't overwrite the file on disk, but it will blast your current edit session. Use with caution. We won't use this for tidy.
Output to a new document in the edit window. This is the best choice for tidy.
Output to the message window (Ctrl+M). This is useful for debugging and the Error tab, but not much else for Output. Not for tidy.
For the Edit tab, the options are the same as the Output tab. Usually, you'll use the message window, to help in debugging, or none option.