Ask Your Question
1

how to specify control caching using HTML meta [closed]

asked 2013-03-03 09:21:45 +0200

jim22 gravatar image

updated 2015-10-26 01:02:19 +0200

Alex Kemp gravatar image

I have many .odt docs that I design in odt and then save as HTML. I am using LibreOffice 3.5.7.2. Requirements: (1) to be able to edit the document or to cenvert the document to odt because that is where I do 98% of the work. (2) Insert cache control meta tags.

I have a need to specify some meta tags that control caching using HTML meta such as: <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/> There are 2 ways to do it. (1) I can use plain text editor in the HTML form, then use LibreOffice to convert the document HTML to odt so that I can continue my editing in odt. If I do that, LibreOffice eats those tags. They just disappear. (2) I can use LibreOffice in .odt format and use the file |properties | custom-properties section to insert HTML tags. Unfortunately I do not see how to insert tags that are more complex than what the “properties” editor can handle which is it can only handle form name=”text”. Any reasonable suggestion will be appreciated. -thanks for reading

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-10-26 01:04:03.347261

3 Answers

Sort by » oldest newest most voted
0

answered 2013-03-03 10:38:47 +0200

qubit gravatar image

Hi @jim22,

What's your workflow like after you export the ODT to HTML?

Would it be possible to have a script that runs though the exported file(s) and inserts all of the appropriate meta tags for you?

edit flag offensive delete link more
0

answered 2013-03-03 22:45:33 +0200

jim22 gravatar image

Thanks Qubit again. I need 15 pts to vote you up. Anyway for other people-- here is a webpage that has some sed script. Did not do it yet, but looks like step in the right direction. http://alvinalexander.com/linux-unix/sed-insert-before-after-line-text

edit flag offensive delete link more

Comments

Ah, excellent.

Just tried out the script. You can add multiple META tags by including a newline character in your changes.sed file:

/<HEAD>/a\

<meta tag 1 here/>\n<meta tag 2 here/>

Good luck!

qubit gravatar imagequbit ( 2013-03-04 05:48:14 +0200 )edit

@jim22 -- Hmm... think I finally wrangled that comment syntax into something that's understandable :-)

qubit gravatar imagequbit ( 2013-03-04 05:55:12 +0200 )edit
1

answered 2013-03-03 22:07:15 +0200

jim22 gravatar image

updated 2013-03-03 22:26:08 +0200

Hi Qubit, thanks for reading. I have a website with about 100 pages. Every day I update about 5-10 of those pages in odt with information for students. Then I save it as HTML. (I keep the odt format for next time when I want to make changes.) Yes following save as HTML, I could run a script that would insert the HTML tags I need. It may have to do something like: if ("Cache-Control" is not in HEAD) then insert these two lines in HEAD <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/> <meta http-equiv="Pragma" content="no-cache"/>

// Your suggestion definitely has merit. The script will have to be rerun every time I make changes to my files. But LibreOffice should also consider (1) not eating HTML tags inserted manually and (2) the properties editor should allow to insert HTML line of text that is just line of HTML like mine. And not eat it later. Do you have a skeleton for such script that I could use? BTW I wanted to give you up vote but the system does not let me (I need to be higher rank). --thanks

edit flag offensive delete link more

Comments

qubit hits you with his +10 karma stick

I think you should be able to upvote and comment now :-)

qubit gravatar imagequbit ( 2013-03-03 22:17:08 +0200 )edit

@jim22,

  1. Okay, have some more karma. You should be able to upvote now :-)
  2. Yes, LO should probably not eat these HTML tags. Please file a bug.
  3. Let's see if I can make you a script for this...
qubit gravatar imagequbit ( 2013-03-04 05:23:15 +0200 )edit

Question Tools

Stats

Asked: 2013-03-03 09:21:45 +0200

Seen: 643 times

Last updated: Mar 03 '13