Using LO Writer to edit HTML

Hi All

Can I get some help on this please??

I have read about, and looked-up, the possibility of editing HTML documents in Writer but can not get it to work!!
No matter what I do I can not fine 'HTML Mode' or 'View HTML' as talked about ion the help files.
I can load my document but can not get at the HTML code.

What am I missing or doing wrong??

I'm using LO 4.3 on PClinuxOS (latest)

Thanks for any help.

IanW
Pretoria RSA

When saving your document, select "HTML Document (Writer) (.html)" in the "File type:" drop down list in the Save dialog.
Kolbjoern

Den 13.11.2014 11:18, skreiv Ian Whitfield:

Hi :slight_smile:
Errr, it's better to use a simple text-editor rather than a word-processor
for this.

Word-processors tend to want to add extra coding or do other odd things.

I'm not sure which text-editor you get by default in PClinuxOS, it usually
depends more on the DE than the OS. It's like that supermarket analogy
again. PClinux OS is one of the supermarkets and the DE can often be
swapped out for another one. If your DE is Gnome then your default
text-editor might well be GEdit, for KDE it's likely to be Kate. Leafpad
is quite nice. There's (in)famous ones such as Vi for command-line only.
There's a huge range.

Mostly in the status-bar at the bottom of the window it'll show the words
"Plain text". You can click on that and choose a wide range of different
mark-up and programming languages. Alternatively one of the menus, such as
"View" might be another way of getting to that drop-down. The
colour-coding is cleverly calculated by the text-editor instead of being
coded into the contents.

Recently i found that GEdit has Extensions/plugins/addons and one helpfully
does some sort of predictive text or/and has a list of commonly used code
and selecting that kinda pastes the bit of code into document. Kate and
the rest probably have similar features.

Regards from
Tom :slight_smile:

Hi Kolbjoern

Thanks for the reply.

The document already exists - so I'm selecting 'File Open', I change the File Type to 'HTML Document (Writer)' and select my file. It then opens in "view" mode - So how do I get to the code to edit it??

After you open the HTML file, click on "View" in the top menu and you should see an option for "HTML Source." On mine, its the third option from the top. Click on that and you should see HTML source code.

At least it works that way on mine. I'm using LO 4.2.7.2 on Ubuntu 14.04.

Virgil

Hi Kolbjoern

Thanks for the reply.

The document already exists - so I'm selecting 'File Open', I change the File Type to 'HTML Document (Writer)' and select my file. It then opens in "view" mode - So how do I get to the code to edit it??

I just tried it again, and I think I see your problem. I did exactly as you did, and the "HTML source" option did not appear on the View menu. I think the problem is that, when opening the file, you are changing the File Type to "HTML Document (Writer)." When you do that, all you get is a WYSIWYG display along with no HTML source option. So, I tried it again, but instead of changing the file type to "HTML Document (Writer)" I kept it at "All types." Then when I opened an HTML file, I saw the source code instead of the WYSIWYG display.

Not sure if this is intended behavior or a bug.

(All this said, I agree with Tom that I would use a regular text editor to edit HTML code. Gedit works nicely on my Ubuntu machine.)

Virgil

That's your mistake: if you select that option, the document is opened as a Writer document instead of a Writer/Web document. Instead, either leave the file type as "All files (*.*)" or else scroll way down and select "HTML Document (*.html;*.htm)". Using one of these, the document will open with "Writer/Web" in the window title instead of "Writer". Now you will find "HTML Source" in the View menu.

I trust this helps.

Brian Barker

To keep things simple you will only be able to edit html files created and saved in Libre Office. To edit all other html files please use a simple text editor like notepad for windows or gedit for linux. Can you tell us the source you "read" and "looked up" that made you believe any html file could be edited with Libre Office?

Steve Wolf

Thanks all.

Well it looks as if the PClinuxOS version of LO has omitted or taken out this function. No matter which way I open the file I get _NO_ option in 'View' that has anything to do with HTML!!
I even tried a 'Save as" selecting HTML and still no luck. (Although doing this changed the names of my images in the code to long miscellaneous number and letter strings!!??!!)

So I'm having to look around .... I know I can use a plain Text Editor but I was hoping for something a little better to help with the editing - like colour coding and selectable Tags etc. I can live without WISIWYG. I'm currently evaluating Komodo........!!

*Steve* - I was looking at (amongst others) -
https://help.libreoffice.org/Common/HTML_Source;
https://help.libreoffice.org/Common/Opening_documents_saved_in_other_formats;
https://doc.opensuse.org/documentation/html/openSUSE_121/opensuse-startup/art.oofficequick.html; (Section 4.5.4)
And the LO Help Window.

Thanks all

IanW
Pretoria RSA

In that operating system, do you have something like right-click | Open With > | LibreOffice Writer? Does that produce the desired effect?

I trust this helps.

Brian Barker

Hi :slight_smile:
I think it's either directly stated or just "hinted at" in a lot of
marketing for word-processors in general.

There is often an expectation that a word-processor is the best tool for
any type of documents. I've even found colleagues using Word to edit
images, that then don't display quite 'properly' in any other version of
Word or anything else. Mentioning the fact that other tools are often
better at - for example, desktop publishing - often seems to annoy people
who then seem to feel it necessary to argue against it and then grumble
when their results are not as good as they'd hoped.

Regards from
Tom :slight_smile:

Hi :slight_smile:
Your default text-editor probably does do both colour-coding and selectable
tags.

It's only Notepad that doesn't and that's only in Windows. You'd be
hard-pushed to find one, even an extremely light-weight one, on a
unix-based platform that doesn't make a strong effort to be useful to any
type of coding work.

Of course when you print or show the code to someone on Windows they don't
see the clever colour-coding.
Regards from
Tom :slight_smile:

YES Brian we do have that in PCLOS - but still the same result... NO option under 'View'.

Thanks though!!

Hi Jan,

Ian Whitfield schrieb:

Well it looks as if the PClinuxOS version of LO has omitted or taken
out this function. No matter which way I open the file I get _NO_
option in 'View' that has anything to do with HTML!!

In that operating system, do you have something like right-click |
Open With > | LibreOffice Writer? Does that produce the desired effect?

YES Brian we do have that in PCLOS - but still the same result... NO
option under 'View'.

try this:
1. menu File > New > HTML Document. Now you should have an HTML-source-icon between ABC-icon and Print-Preview-icon. If it is not there, see below.
2. menu Insert > Document.
3. Click on the HTML-source-icon. You have to save the file, otherwise HTML-source view is not possible.
4. Click the icon again to switch back to Web-Layout.

If the icon is not there, you can customize the toolbar. You find the command 'HTML source' in the category 'Options'.

If New > HTML Document is missing, use the macro (you might need to correct line breaks):

sub createHTML
Dim NoArgs() as new com.sun.star.beans.PropertyValue
Dim oDocument as Object
Dim sUrl as String
sUrl = "private:factory/swriter/web"
oDocument = StarDesktop.LoadComponentFromURL(sUrl,"_default",0, NoArgs())
End Sub

Kind regards
Regina

The old way.

Save as text file.
Edit as text file.
Save as text file.
Change extension to ".htm"
Open with browser.

It's not pretty, but it never fails.

The easier way out maybe to take a look html page development on FireFox Web Developer's Toolbox or BlueGriffon at http://bluegriffon.org/

Hope this helps.

Yes, a text editor helps for some editing of an HTML file. Yet, for some work I need a WYSIWYG editor for the look and feel of the web document.

I use Kate [Ubuntu based Linux Mint] for the text editor. I use it for the Find/Replace option to change 91 links from [say] "4.3.3.2_" to "4.3.4.1_". That takes too much time in a WYSIWYG editor, or at least the ones I have used.

Currently I use Kompozer, but when I upgrade from Mint 16 to 17 [14.04 based] and beyond, the graphical display methods do not like the upgraded version that Ubuntu 14.04/14.10 now uses. So I will be looking for a different DEDICATED web page editor.

Yes, Writer can do the HTML editing, but I would prefer a WYSIWYG editor that was created specifically for web page editing and hopefully with error checking options.

Yes, a text editor helps for some editing of an HTML file. Yet, for some work I need a WYSIWYG editor for the look and feel of the web document.

I use Kate [Ubuntu based Linux Mint] for the text editor. I use it for the Find/Replace option to change 91 links from [say] "4.3.3.2_" to "4.3.4.1_". That takes too much time in a WYSIWYG editor, or at least the ones I have used.

Currently I use Kompozer, but when I upgrade from Mint 16 to 17 [14.04 based] and beyond, the graphical display methods do not like the upgraded version that Ubuntu 14.04/14.10 now uses. So I will be looking for a different DEDICATED web page editor.

Yes, Writer can do the HTML editing, but I would prefer a WYSIWYG editor that was created specifically for web page editing and hopefully with error checking options.

I haven't followed the thread with great care so I may have overlooked a reference to 'bluefish'. <http://bluefish.openoffice.nl/features.html>

I haven't used it in quite a spell so this isn't a 'recommendation', just a reference to a tool which might be of use.

it is not, I think, wysiwyg as such but it will open your browser for inspection of results. (looking at the website it seems it may open your page within bluefish but I'm skimming too fast to be sure.)

see what you think.

(apologies if this has already been considered.)

F.

I use to "hand code" everything and then check my work in a browser. Now with more complex pages, it can be very hard to keep one edited without using a WYSIWYG editor. Yes, I use text editors for some things, but there are a lot of things that need the editing while viewing the page, and not just the code.

Hi :slight_smile:
I think the coding is to be published in a book / manual / guide. Perhaps
teaching people the basics or giving appropriate examples.

I think Ian was looking for some method to use coding in a document in much
the same way that Math is used to write equations for documents so that the
equation can be seen. We have been trying to push him into using the
equivalent of Calc to give the correct answer when he's really looking for
something to show the equation in all it's intriguing beauty.

Bluefish is often recommended and i gather it's a bit like Dreamweaver in
having a wysiwyg alongside a coding window/pane. I only had a brief go at
both those but they made me feel really uncomfortable. Real world
web-browsers have their own quirks and i'm not sure how faithfully a
wysiwyg editor reproduces their errors. So, i tend to have at least 1
web-browser open to see the real-world effect of code that i write (well,
mostly copy&paste & modify tbh) in a text-editor.

It's interesting to see this thread has forked in 2 directions. There are
these sorts of answers on how to write good, reliable code to be used
directly and the other fork is about how to make it look pretty for print.

Regards from
Tom :slight_smile:

Here is the list of languages that Bluefish's page states it has language definitions for.
Yes there are a lot, but it seems to me that this package is more than a HTML creation/modification page editor.

     Ada
     ASP .NET and VBS
     C/C++
     CSS
     CFML
     Clojure
     D
     gettext PO
     Google Go
     HTML, XHTML and HTML5
     Java and JSP
     JavaScript and jQuery
     Lua
     Octave/MATLAB
     MediaWiki
     NSIS
     Pascal
     Perl
     PHP
     Python
     R
     Ruby
     Shell
     Scheme
     SQL
     SVG
     Vala
     Wordpress
     XML