Hi guys,
I'm editing some plain text. It's a article and it will be published on web in HTML. How could I add paired tags to a paragraph? The only way I know is
1. go to paragraph begin, write <p> 2. delete </p> (autoclosing) 3. go to paragraph end 4. write (or copy) </p>
I've used Quanta with user-defined hotkeys for years. They helped a lot - Ctrl-; for applying <p></p> to a selection, Ctrl-1 for pasting <h1></h1> and so on.
How to do this with Geany?
Second:
How to join lines with hard breaks (in fact paragraphs)?
Thank you for a great editor,
regards,
Hi,
On Mon, 30 Mar 2009 17:30:32 +0200 Vlastimil Ott linux@e-ott.info wrote:
I'm editing some plain text. It's a article and it will be published on web in HTML. How could I add paired tags to a paragraph? The only way I know is
- go to paragraph begin, write <p>
- delete </p> (autoclosing)
- go to paragraph end
- write (or copy) </p>
I've used Quanta with user-defined hotkeys for years. They helped a lot - Ctrl-; for applying <p></p> to a selection, Ctrl-1 for pasting
<h1></h1> and so on.
How to do this with Geany?
Right now I don't know of a way doing this, but I've implemented something similar on GeanyLaTeX plugin inside. Maybe this piece of code can be ported to also fit for XML/HTML. MAybe not the best code doing this, but at least it's working ;) http://git.geany.org/geany-plugins/tree/geanylatex/src/latexenvironments.c#n...
Cheers, Frank
On Mon, 30 Mar 2009 17:30:32 +0200 Vlastimil Ott linux@e-ott.info wrote:
How to join lines with hard breaks (in fact paragraphs)?
Thank you for a great editor,
I hope I understood what you like to do. If no,please send a little code example.
Here you might can use the Search and Replace feature and replace \n\n e.g. with an empty string.
Cheers, Frank
On Monday 30 March 2009 18:44:24 Frank Lanitz wrote:
I hope I understood what you like to do. If no,please send a little code example.
I mean lines which end with a hard break. Every line is a paragraph.
Here you might can use the Search and Replace feature and replace \n\n e.g. with an empty string.
Yes, but... Is there a "one key" solution? Something like Ctrl-j. I will target the content, not the form. I don't want to think about regexp when writing an article.
Thanks for your answer,
On Mon, 30 Mar 2009 21:30:27 +0200 Vlastimil Ott linux@e-ott.info wrote:
Here you might can use the Search and Replace feature and replace \n\n e.g. with an empty string.
Yes, but... Is there a "one key" solution? Something like Ctrl-j. I will target the content, not the form. I don't want to think about regexp when writing an article.
None I know of.
Cheers, Frank
Vlastimil Ott wrote:
I'm editing some plain text. It's a article and it will be published on web in HTML. How could I add paired tags to a paragraph? The only way I know is
- go to paragraph begin, write <p>
- delete </p> (autoclosing)
- go to paragraph end
- write (or copy) </p>
I've used Quanta with user-defined hotkeys for years. They helped a lot - Ctrl-; for applying <p></p> to a selection, Ctrl-1 for pasting <h1></h1> and so on.
For stuff that you do regularly, you can write a simple script (shell / python / your favourite scripting language) that does the job for standard input, and set it as a Custom Command:
Edit > Format > Send Selection To > Set Custom Command
The first three have hotkeys.
I did this for a few common things, but I hardly use that any more because I find that knowing how to do regular expression search and replace is more flexible (but I still have scripts for stuff like URL-encoding).
To wrap a selection with <p>...</p> you can do this in regex search/ replace:
Search for: (.*) Replace with: <p>\1</p> Use regular expressions: ticked
If you select a piece of text within a line and click the In Selection button, just that piece is wrapped with <p>...</p>. If you select a bunch of lines, each line is wrapped with <p>...</p>.
You might want to mix the Set Custom Command method with the regex search and replace method.
How to join lines with hard breaks (in fact paragraphs)?
Yeah, also awaiting an answer to that one...
On Tue, 31 Mar 2009 09:31:14 +1100, Ross wrote:
How to join lines with hard breaks (in fact paragraphs)?
Yeah, also awaiting an answer to that one...
What's wrong with Frank's suggestion?
"Here you might can use the Search and Replace feature and replace \n\n e.g. with an empty string."
If that's not a solution, you might should be more clear about what you actually want to do.
Regards, Enrico
Enrico Tröger wrote:
What's wrong with Frank's suggestion?
"Here you might can use the Search and Replace feature and replace \n\n e.g. with an empty string."
Duh! I was sure I'd tried that before and failed. I guess it's true what they say - "Failure - can't spell it without U R A" :)
cheers, Ross.
On Mon, Mar 30, 2009 at 11:30 AM, Vlastimil Ott linux@e-ott.info wrote:
Hi guys,
I'm editing some plain text. It's a article and it will be published on web in HTML. How could I add paired tags to a paragraph? [snip]
Not exactly what you seem to be asking for, but, could you leave it as plain text and then have a txt --> html processor do it for you?
If so, you might have a look at [pandoc](http://johnmacfarlane.net/pandoc/). Write your doc in its extended Markdown format, then have pandoc crunch it into html for you.
On Tuesday 31 March 2009 05:44:16 John Gabriele wrote:
John,
thank you for your ideas.
Not exactly what you seem to be asking for, but, could you leave it as plain text and then have a txt --> html processor do it for you?
No, don't think so.
If so, you might have a look at [pandoc](http://johnmacfarlane.net/pandoc/). Write your doc in its extended Markdown format, then have pandoc crunch it into html for
Yes, markdown or txt2tags are great tools but: I don't write the text. Usually it's a result of OOo Writer export, some HTML [WYSIWYG] editor etc. I'm editor of Czech Linux magazine LinuxEXPRES.cz. The authors send me their articles in HTML/ODT/plain text/mark down/what ever I can work with and I usually convert it to HTML; every time some changes are needed.