Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-07-2011, 01:26 AM   #1
sdfs
Junior Member
sdfs began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2011
Device: none
how to edit source code of .htm doc?

I have been reading the XPATH tutorial in the caliber User Manual because I want to put some chapter headline tags into an .htm document that I am converting into an ebook. The instructions in the tutorial for how to write the tags are clear enough, but the tutorial does not explain how to actually get at the source code of the .htm document. I guess the assumption is that if you are fiddling with code, you already know that, but I am relatively new to this.

Can anyone advise?

The .htm doc was created from a Word 2004 doc (in Mac) using the "save as" function.

Here's the tutorial:
http://manual.calibre-ebook.com/xpat...xpath-tutorial
sdfs is offline   Reply With Quote
Old 07-07-2011, 04:32 AM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
A .htm file is a text file so can be edited with any editor capable of handling text files.

Having said that there are lots of editors around that are HTML 'aware' and give you special support for HTML editing.
itimpi is offline   Reply With Quote
Advert
Old 07-07-2011, 10:29 AM   #3
sdfs
Junior Member
sdfs began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2011
Device: none
Quote:
Originally Posted by itimpi View Post
A .htm file is a text file so can be edited with any editor capable of handling text files.

Having said that there are lots of editors around that are HTML 'aware' and give you special support for HTML editing.
Thanks for your answer. I read that this was supposed to be the case, but it is not so. Opening the .htm document in a text editor does not grant you access to the code. It only allows you to edit the content.

I did more research last night, and it seems you need to use a script editor to gain access to the actual .html code behind the document.
sdfs is offline   Reply With Quote
Old 07-07-2011, 10:36 AM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by sdfs View Post
Thanks for your answer. I read that this was supposed to be the case, but it is not so. Opening the .htm document in a text editor does not grant you access to the code. It only allows you to edit the content.
What editor are you using? Any text editor should expose all of the code.

Quote:
Originally Posted by sdfs View Post
I did more research last night, and it seems you need to use a script editor to gain access to the actual .html code behind the document.
I have never needed a special editor. I use either notepad++ or Sigil to edit my books at the html level.

Good Luck.
DoctorOhh is offline   Reply With Quote
Old 07-07-2011, 10:39 AM   #5
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by sdfs View Post
Thanks for your answer. I read that this was supposed to be the case, but it is not so. Opening the .htm document in a text editor does not grant you access to the code. It only allows you to edit the content.

I did more research last night, and it seems you need to use a script editor to gain access to the actual .html code behind the document.
Itimpi is correct, you are misinformed. Either you are using an html editor in its WYSIWG mode (that hides the html code) or you are referring to the html output of a server script and you are trying to get to the server script (which the server won't give you).
Starson17 is offline   Reply With Quote
Advert
Old 07-07-2011, 10:40 AM   #6
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by dwanthny View Post
I use either notepad++ or Sigil to edit my books at the html level.
Will Sigil open html files? I've used it for epub, but never tried to open html.
Starson17 is offline   Reply With Quote
Old 07-07-2011, 10:42 AM   #7
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by Starson17 View Post
Will Sigil open html files? I've used it for epub, but never tried to open html.
I recall opening a html in Sigil then saving it as a ePub. At least that's my recollection.

Edit: I just tried it again and Sigil does great opening html and saving it as ePub. Of course this is one editor that doesn't reveal the code until you switch to code view.

Last edited by DoctorOhh; 07-07-2011 at 10:45 AM.
DoctorOhh is offline   Reply With Quote
Old 07-07-2011, 10:42 AM   #8
sdfs
Junior Member
sdfs began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2011
Device: none
Quote:
Originally Posted by dwanthny View Post
What editor are you using? Any text editor should expose all of the code.



I have never needed a special editor. I use either notepad++ or Sigil to edit my books at the html level.

Good Luck.
Okay, so something is not right with my text editor, then.
sdfs is offline   Reply With Quote
Old 07-07-2011, 10:44 AM   #9
sdfs
Junior Member
sdfs began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2011
Device: none
Quote:
Originally Posted by Starson17 View Post
Itimpi is correct, you are misinformed. Either you are using an html editor in its WYSIWG mode (that hides the html code) or you are referring to the html output of a server script and you are trying to get to the server script (which the server won't give you).
I am using TextEdit v 1.6 (standard on a Mac). It is in WYSIWG mode, but I can't figure out how to turn that off.
sdfs is offline   Reply With Quote
Old 07-07-2011, 10:51 AM   #10
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by sdfs View Post
I am using TextEdit v 1.6 (standard on a Mac). It is in WYSIWG mode, but I can't figure out how to turn that off.
Change the Preferences, then quit and re-open the file. Go to TextEdit --> Preferences... and choose "Open and Save".

Under TextEdit Preferences, the first option under "When opening a file": you want to check Ignore rich text commands in HTML files. Check that option, then quit TextEdit.
You can also do this by manually selecting File --> Open..., choosing the file, and also selecting the option in the Open dialog window of "Ignore rich text commands",
Starson17 is offline   Reply With Quote
Old 07-07-2011, 10:55 AM   #11
sdfs
Junior Member
sdfs began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2011
Device: none
Quote:
Originally Posted by Starson17 View Post
Change the Preferences, then quit and re-open the file. Go to TextEdit --> Preferences... and choose "Open and Save".

Under TextEdit Preferences, the first option under "When opening a file": you want to check Ignore rich text commands in HTML files. Check that option, then quit TextEdit.
You can also do this by manually selecting File --> Open..., choosing the file, and also selecting the option in the Open dialog window of "Ignore rich text commands",
You're my hero, Starson. That worked perfectly. Many thanks!
sdfs is offline   Reply With Quote
Old 07-07-2011, 11:31 AM   #12
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by sdfs View Post
You're my hero, Starson. That worked perfectly. Many thanks!
I'm glad it worked for you.
Starson17 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Let's create a source code repository for DR 800 related code? jraf iRex 3 03-11-2010 12:26 PM
Source Code Reading Jamp Workshop 3 07-16-2009 03:20 PM
Source code available AlfonsVH HanLin eBook 3 01-03-2009 02:30 PM
pdf/fb2/doc/htm for Explay txt.book Software bbhk888 Reading and Management 3 10-21-2008 05:21 PM
source code?? joblack iRex 1 11-01-2006 12:16 PM


All times are GMT -4. The time now is 01:32 AM.


MobileRead.com is a privately owned, operated and funded community.