Tuesday, June 9, 2020

Assisted Seated Chest Fomentations, Hot Foot Bath and Cold Mitten Friction


For Chest Infections, if you have someone who is willing to treat you.
Remember to use personal protective equipment.
Check out the protocol at https://www.hydro4covid.com/fomentation-foot-bath.html

Tuesday, April 21, 2020

Seated Chest Wrap and Hot Foot Bath

A fellow hydrotherapist showed me compelling information about the importance of chest fomentations early in COVID rather than later so here is a way you can get some of effect yourself. The original inspiring video has disappeared but I think mine is better. See the protocol below.

The Hydro4COVID website is up with the latest version of the protocol and I was advising fomentations when chest symptoms had developed. I now think this is too late! But couldn't think of a way for someone to give themselves fomentations.

It is important to treat yourself in that time after symptoms first appear because:

  1. You don't want to infect family or friends if you have COVID-19
  2. You may live alone
  3. You can treat yourself when you need to or can fit it in.
But I couldn't think of how to change fomentations by yourself.


Then I remembered this video.

This video only covers the chest wrap. I like that it only requires two towels! Vastly better than the 10 we need for the regular bath. I think it is good but could be improved with the addition of the hot foot bath and a short cold at the end.

Protocol

If I developed symptoms of COVID-19, I would call my doctor and make an appointment for testing. Then at the first convenient time (and I would need at least 2 hours including preparation and rest):

  1. Get my bed ready for a good rest (warm covers, window open if good air outside)
  2. Set up a warm area as near to your bathroom, shower, bedroom as possible and set up an armchair in a place where a little bit of water on the floor doesn't matter or cover the carpet with some sort of waterproof material. Cover the chair with waterproof material, and a blanket and sheet.
  3. Turn on the warming for your shower/bathroom. Place your pyjamas near the shower with your bath towel. 
  4. Spread a large warm blanket (or two) where you can spread it over yourself and the footbath, while seated in the chair. 
  5. Prepare a Hot Foot Bath in front of the armchair. Make it as hot as you can stand (test with elbow if no thermometer) and boil a kettle and place within reach of the chair.
  6. Place another towel, folded double as a bath mat, next to the footbath, on the side you get into / out of the chair.
  7. Prepare a Cold Compress as shown in the Hot Foot Bath. Make the bowl extra large (at least 2 litres or 2 quarts) if you want to use the water for a cold pour after the treatment. place within easy reach of the chair.
  8. Have a drink of hot water, to start the heating process.
  9. Undress and toilet
  10. Prepare the wrap on your bed as shown in the video above and lie down on it. Wrap yourself up as quickly as you can. Hold the wrap on and go to the chair. 
  11. Add hot water to the foot bath if needed, still holding the wrap.
  12. Sit down in the armchair and place feet in foot bath. 
  13. Lean back in the chair and wrap yourself and the footbath as warmly as possibly in blankets you are sitting on and those beside the chair. Try not to get the blankets in the foot bath. 
  14. Use the cold compress to cool your head as needed. Reaching out carefully so not let too much hot air in.
  15. Stay until sweating.
  16. Carefully uncover. Take your feet out of the footbath and place on towel on the floor
  17. Take off the rest of the covering and the wrap.
  18. Get up slowly, be careful not to fall.
  19. Grab your towel (and the Cold Compress bowl if you are using a cold pour.)
  20. Quickly go to the shower area and have either a few seconds of cold shower (5 seconds is plenty) on the back of your neck /upper back or pour the Cold Compress water over your neck.
  21. Get dressed in your pyjamas and go to bed for at least 30 minutes.
  22. Leave the chair where it is for the next two days as you should repeat this for the next two days at least.
Long list but that would be a good treatment.

Monday, March 23, 2020

Help! Fomentations for COVID-19


Good morning,

I'm needing your help, and so are a few billion others.

A GP (family physician) friend of mine asked me for something to share with fellow GPs about hydrotherapy for COVID-19. Fortunately this friend was NOT happy with my ramblings on the topic, so I spent my Sunday going back to the books, specifically "Physical Therapy in Nursing Care" telling of the successful treatment of the last pandemic, the 1918/19 Spanish Flu.

So the treatment is: hot fomentations to chest and spine with simultaneous hot foot bath and cold compress to head followed by cold mitten friction once or twice daily with absolute bed rest between.
 
Basically they treated the person as if they had pneumonia right from the beginning.

So I wrote a page as requested for the General Practitioners' perusal.

But then I woke up this morning and realised it was useless!

How is it possible for an untrained person to do this treatment... safely (I've burnt people with fomentations), effectively (I've hospitalised a lady by changing things slowly and allowing her to get chilled... and consequently making her condition worse, I was lucky/blessed not to have killed her) and efficiently (if I follow the directions for hot fomentations I need 10 towels and 5 each fomentations and covers for just one treatment. If I don't have foments/covers then that's 10 more towels. 20 towels! Twice a day!)

And to be really effective, both the fomentations and the friction work best with 2 therapists. And finally, I don't remember ever doing that treatment. It's too much work! I don't remember treating pneumonia either. And I had a staffed hydrotherapy department at my disposal.

This treatment is big and dangerous but apparently, powerfully effective.

 In the past I've effectively treated all the fevers, flu, dengue, malaria, glandular with a strong, individualised revulsive to sweating, daily for 3 days, but I'm sure we are going to need something more targeted at Active Chest Congestion before this thing is over.

I've checked the Pneumonia and Active Chest Congestion pages on the website and the only alternative seems to be hot blanket pack (which doesn't really excite me - "Make sure the blanket is wrung dry of all water - patient may be scalded otherwise")

So you can help me by answering these questions (or sending this on to someone who can answer them):

1. Have you ever used the protocol (Fo chest back, HftB, CMF) for pneumonia? How did it go?

2. Can you think of a modern, safe and simple alternative way of heating the chest/spine to erythema with moist heat? It should be ubiquitous and cheap.

3. Any other thoughts and suggestions... So many people have contacted me lately that I'm wondering if this is the time.

 Here are links to:

My ramblings, "Treatment for Coronavirus"
The successful treatment of Spanish Flu in an Adventist seminary
And most importantly - The whole chapter on Acute Infections of the Respiratory System from Physical Therapy in Nursing Care.

Thank you for your help, I really do appreciate it,
Bruce

Wednesday, February 5, 2020

Prevent and treat the novel Coronavirus (probably)


I say "probably" because:
  1. I haven't treated the disease so I don't know for sure,
  2. The treatment I will tell you about works for normal flu, and every other fever I've thrown it against including dengue, malaria, and glandular fevers. I can't see why it shouldn't be effective in treating coronavirus too.
I was inspired by Dr Wes Youngberg's talk to write this post. I think  he is worth listening to, but there are two problems: it is way, way too long and more importantly, the hydrotherapy is not accurate. Dr Youngberg suggests we use the same hydro as was used successfully in the 1918 Spanish flu epidemic that killed somewhere between 50 million and 100 million worldwide (15,000 in Australia).

The section of the talk on hydrotherapy was good because it reinforced what I already knew about treatment of the 1918 Spanish flu and it gave me another case study (no deaths for 90 patients when the usual mortality ran at 10-20%)

But coronavirus isn't any Spanish flu.

Spanish flu induced a "cytokine storm" with more than half the deaths being in healthy people aged 20-40 years. The coronavirus seems more like a regular flu in that most of the deaths are in older people with diseases like diabetes.  

When you do hear about the next epidemic that kills the healthy young then certainly try the treatment for the Spanish flu, as Dr Youngberg recommends, but it won't be the best for coronavirus.

The hydrotherapy treatment for Coronavirus

  1. Assume that any time you get a fever or chest symptoms that you are getting coronavirus and begin treatment immediately. If you get onto it early you will probably abort the disease, what ever it is.
  2. First treatment: heat the body until you can see sweating on the top lip. Depending on the method it should take 15 to 20 minutes (no longer). Keep the head cool during this process. My favourite way is steam bath but sauna, hot foot bath (with or without fomentations) or hot tub bath will work. Here in our Aussie summer I know people who use the colourbond garden shed, or wrap themselves in black polythene sheeting and lie in the sun. But remember to keep your head cool! And don't use exercise. You can damage your heart doing that.
  3. Follow up with short cold. Here in summer our shower water isn't cold enough, so get someone to throw 2 litres of ice water over your upper back while you stand in the shower. But in winter, just use the cold water from the shower on the nape of your neck until it makes you inhale sharply. 5 seconds of cold water is enough. If you have good friends a cold mitten friction is great.
  4. Then go to bed! After you dry thoroughly of course. Rest is essential for at least 30 minutes. Stay warm too. 
  5. Only do the treatment once a day for a total of 3 days. You should be right by then.

Preventing Coronavirus

The usual natural remedies should strengthen your immune system:

  1. Whole-food plant-based diet - eat the best food you can afford. Lots of greens, and fruits and vegetables with lots of colour, and onions, garlic especially if you're worried.
  2. Exercise outside - even gentle exercise has lots of benefits for your immune system. 
  3. Sunshine
  4. Deep breaths of fresh air in nature.
  5. Drink lots of filtered water, a few extra glasses if you're worried.
  6. Stay away from alcohol and smoke
  7. De-stress. I use Meditating with Jesus
  8. And get plenty of good sleep.
If you do these you will not only prevent most common infections but also prevent most of the lifestyle diseases that are too common today.

Image by Gerd Altmann from Pixabay

Monday, February 6, 2017

All New web site

Take a look at the all-new Traditional Hydrotherapy site.

The site was looking a bit tired so I decided to update it and make it mobile-friendly as well. Even more satisfying has been the addition of full treatment procedures for most of the common techniques. No more dragging out the text book. And there are more pictures too.

A big thank you to the students from the Toronto hydro class for typing those procedures up. And thank you for coming along to the classes, it reinvigorated my enthusiasm for hydrotherapy. Actually it was after realising that I had to insert the procedures that got me thinking about changing the layout as well.  Traditional Hydrotherapy owes a lot to the Hydro class of 2016.

Pretty, pictures and procedures... even the Russian bath has some glamour.

Enjoy! Please let me know if anything is broken, I didn't get time to check all the pages.

One thing I'm a little disappointed in is the drop-down menu, it is a bit slow. Let me know if you don't like it, I'll put in a static one.

For those who are interested, yes, all the html and css work was done with trusty old Vim. Gotta love those keyboard macros for changing hundreds of pages in a few minutes.

The template was downloaded from w3layouts. They have a luscious looking range of responsive (mobile-friendly) templates for free! It took almost as long to choose one as it did to apply it. BTW I settled on the Vocation template. And if you look closely I didn't really have to modify it that much.

Thursday, December 22, 2011

Inflammaging

Inflammaging is probably the most surprising thing I have learned in 2011. In future posts I will explain how hydrotherapy and inflammaging interact but, for now, let's look at what inflammaging is.

  Claudio Franceschi coined the term back in 2006,"to explain the now widely accepted phenomenon that ageing is accompanied by a low-grade chronic, systemic up-regulation of the inflammatory response and that the underlining inflammatory changes are also common to most age-associated diseases." (Giunta)

 Synonyms: Other researchers call it: Metaflammation, Para-flammation and Smouldering Inflammation.

 Acute Inflammation
 An acute inflammation is where the body is threatened by a pathogen, toxin or injury, the "pro-inflammatory markers", such as cytokines, are produced and the immune system responds accordingly. As the threat is neutralised, the anti-immune system kicks in, the number of inflammatory markers goes down and the immune system returns to normal. This usually takes between 3 days to about 3 weeks.

 But inflammaging is a low-grade, chronic, asymptomatic, feedback loop, that continues for years. Characterised by an over-active, but weak, immune response (lots of cytokines) and a weak anti-inflammatory response (unable to turn off the immune system). This results in simultaneous tissue damage and tissue healing over decades causing damage of specific cells and disfunction of organs.

 Diseases with definite links to inflammaging:
  • Obesity (as much as 65%)
  • Heart disease, stroke
  • Diabetes II,
  • Many cancers
  • Polycystic ovary syndrome
  • Alzheimers
  • Depression
  • Persistant pain
Diseases with probable links to inflammaging:
  • Some Allergy
  • Arthritis
  • Asthma
  • Lupus
  • Crohns
  • Psoriasis
  • Parkinsons
  • Multiple Sclerosis
  • Inflammaging
This doesn't mean that all these diseases are a result of inflammaging but that the increased incidence of these diseases is probably due to inflammaging. Co-morbidities to inflammaging include:
  • Increased Oxidative load (oxidised lipids)
  • Insulin resistance
  • Subclinical viral infection
  • Epigenetic damage (damage to the parts of DNA that surround the genes and controls which genes are expressed)
Inflammaging isn't caused by something specific, it is "induced". Inducers of inflammaging include:
  • Obesity
  • Nutrition - excessive:
    • saturated fat intake
    • glycaemic load
    • fructose drinks
    • salt
    • alcohol
    • and starvation
  • More Inducers of inflammaging :
  • Inactivity
  • Smoking - passive smoking
  • Inadequate sleep
  • Stress
  • Anxiety/ Depression
  • Pollution
The underlying factor is our lifestyle today, most of these inducers have only been common since the industrial revolution. Protectors against Inflammaging:
  • Activity
  • Adequate water
  • Sunshine – light
  • Temperance
  • Air - breathing
  • Rest – sleep, stress control
  • Trust in a loving God
Nutritional Protectors include:
  • Fruits/ vegetables
  • Nuts
  • Mono-unsaturated fats
  • Tea
  • Dark chocolate
  • Omega 3-6 ratio
  • Mediterranean diet
  • Calorie restriction
  • Anti-oxidants (in foods - not supplements)
To summarise, Inflammaging is the normal increase in metabolic inflammation as we grow older. But if we had a 'non-inflammatory' early life it goes up more slowly.

 Reversible
However, Inflammaging is reversible.

 To find out more just follow the links I have here or Google Inflammaging or Metaflammation.

Sunday, October 24, 2010

Dengue Fever Remedy

Hydrotherapy cures Dengue in just three days.

Chikungunya and dengue are just two of the diseases carried by this Asian Tiger Mosquito. And it is coming to Australia! If you want to start to feel really uncomfortable read (or listen) to ""Dengue Epidemic" replayed this month on ABC Radio National. This little mossie is called the "barbecue stopper" because of their nasty sting. Even their name, Aedes, means "unpleasant".

The good news, after listening to that programme is that hydrotherapy treatments are effective for most fevers, I have had most experience with Dengue, but have treated glandular fever and childhood fevers.

The first important point about treating fevers with hydrotherapy is to begin as soon as the fever is detected. It doesn't matter what actually causes the fever, hydrotherapy is effective for most. An early start means that the disease is resolved more quickly, decreasing the chance of the serious complications like cerebral malaria and haemorrhagic dengue. Patients also miss out on those non-fatal but painful bone and joint pains in dengue and chikungunya.

Second, work out which sort of fever it is. In dengue (and all the other diseases mentioned in this post) it is commonly a Retention Fever with cold skin, shivering, goose bumps and chilly sensations.

Treatment is similar to my previous post on Malaria. That is, a Sweating Treatment followed by a Graduated Tonic Cold, daily for three days.

In practice this is the regime we used for dengue:
Russian Bath for 20 minutes, until sweating profusely, followed by Cold Mitten Friction, daily for three days. We never needed a fourth treatment as all the people we treated had recovered enough to leave hospital without any weakness or tiredness. This compares to the usual ten days in hospital followed by weeks of lethargy. Kellogg recommends using the Cholera treatment while febrile, which is a Hot Blanket Pack then Cold Mitten Friction.

For Glandular Fever I used a Hot Tub Bath until sweating, followed by a Cold Shower. Once again this was daily for three days when the patient was fully recovered and returned to work.

However you can use whatever Sweating Treatment is handy for you. The Sweating Pack is very good and Cold Pours are easily done after Packs and Tub Baths.

One reason that these treatments are so effective is that they really boost the immune system. The white cell count is often trebled by the third day. This was confusing for our referring doctors initially, as they thought the patients were developing another infection, when the patients were feeling quite well and eager to leave hospital.

Another important benefit of treating fevers with hydrotherapy is that the patient doesn't have to expend the huge amount of energy required to produce the fever needed to respond to the disease.

It is a surprise to most people that fevers are a good thing (as long as they don't get too high). Fevers are the front line of the immune response to infection and the hydrotherapy treatments listed here push heat into the body, assisting the rise in body temperature without the body having to work so hard. This is why there is less weakness or prostration after a fever treated with hydrotherapy.

I would love to hear of your experience with fevers so please leave a comment.

Tuesday, September 28, 2010

Morning Sickness Remedy

Heating Trunk Packs relieve nausea and pain during pregnancy.

More than half of all pregnant women suffer from morning sickness but the treatment typically aims "to lessen the symptoms of nausea, rather than attacking the root cause(s) of the nausea" (Wikipedia). This usually means that a mother suffers weeks of discomfort, and sometimes distress, during pregnancy. This can be avoided with hydrotherapy.

Dr Abbott, when talking about severe morning sickness (hyperemesis gravidarum), said the Hot and Cold Abdominal Pack is an "almost never-failing remedy".

When she is pregnant my wife has relatively mild morning sickness and used hydrotherapy in her last two pregnancies. One treatment would relieve morning sickness for about two weeks when it would be repeated with similar effects. She has used it on other women with similar results. All of the cases I am aware of were not severe, but they uniformly had relief.

For use at home, the Heating Trunk Pack is the safest and easiest. Because it seems a little complex to the beginner, I wrote up the full procedure. Kellogg says the cause of morning sickness is Celiac Congestion and so the treatments are all Vascular Antiphlogistics any of which would probably work so if you want to modify things then go ahead.

Please leave a comment if this treatment helps you, or someone you love, enjoy their pregnancy without the effects of nausea.

Sunday, September 19, 2010

Malaria Treatment

A friend on the western border of Thailand sent me a email asking about treating malaria with hydrotherapy.

This makes sense because a lot of the malaria in this area is resistant to preventives and can lead to cerebral malaria, which if it doesn't kill, often leaves the person with major brain damage. I know this because I taught hydrotherapy up on the Burma border about 20 years ago and saw the results of malarial infection.

The Traditional Hydrotherapy page on Malaria lists a lot of treatment methods but basically it is a heating treatment until the patient starts sweating and then a Graduated Tonic Cold which is a short cold treatment. Then the patient is wrapped up warmly to sleep and for other treatments.

As with all treatment, the sooner it is started, the better. One of hydro's great advantages is that it doesn't interfere with other treatment and even if we have misdiagnosed, it won't cause any damaging side effects in most cases.

So... if it looks like it may be malaria, start treating it straight away before the patient gets weak.

On days 1,2 and 3 do something to get the patient sweating (but make sure they have a Cooling Compress on their head). The hill tribe people I worked with wrapped a patient in black polythene plastic out in the sunshine, to achieve sweating.

Once sweating started do a quick cold treatment. The tribe's people would quickly dunk them in the very cold river.

They are kept warm between treatments.

The principles are much the same for all fevers.
If you have experience at treating malaria successfully with hydrotherapy, please contact me.

Sunday, September 12, 2010

Traditional Hydrotherapy is Online!

This is really a big day. At long, long last the website is now live.

It has taken exactly a year from when I decided to get serious about turning Traditional Hydrotherapy from a dinky DOS programme into a stunning (hyperbole) website. And 19 years after I started going through the original books and putting them on HyperHelper.

Admittedly the content is still the same, it just looks a whole lot more attractive. It is easier to use with redundant cards combined and plenty of indexes and navigation added.

Please visit Traditional Hydrotherapy and tell me if you find mistakes. There must be some!

I'm not sure when the Google Search function will begin working. Google has to index the site first. Apart from that it looks good to me.

For those of you who can actually use the information on the site, I would love you to tell me how it goes. If I get enough feedback I will start a forum where you can add to the knowledge base of currently used and successful (or unsuccessful) hydrotherapy.

Big sigh of relief... and prayer of thanks to God.

What am I going to do now? Maybe get some more sleep... or relaxation? Software Freedom Day next weekend so that's next Sunday out.

Vim Makes a Sitemap File

This is probably the last tech (Vim) post I will be making as Traditional Hydrotherapy is online.

To try to jump start Google into indexing the site, I made a sitemap.xml file manually. I'm not sure if it will work, but I submitted it to Google anyway.

The instructions were quite clear from Manually Creating Sitemap Files, but how to achieve it quickly with Vim and over 900 files to index?

I used Split Screens, Reading-in files and, of course a repeating Macro.

I started by manually doing my home directory and making sure the parts worked. This was the longest part of the process and involved making some files (to read in) and the macro.

I had to produce code like this for each file:
<url>
<loc>http://www.traditionalhydrotherapy.com/Problems/VisceralCongestion.html</loc>
<lastmod>2010-08-17</lastmod>
</url>

I first made two files "top.n" and "end.n" to get the beginning and end of the url block
This is top.n:
<url>
<loc>http://www.traditionalhydrotherapy.com/Problems/
This is what end.n looked like:
</loc>
<lastmod>2010-08-17</lastmod>
</url>
Then I opened "sitemap.xml" in the hydro home directory (where the file would end up) and split the screen to "Problems/PageIndex.html" (using :sp Problems/PageIndex.html). PageIndex consist of an alphabetical list of all the pages in the directory, in this case the Problems directory.

I had to get the cursor in the right place in both files so moving to the line above the first file in the PageIndex list I then used Ctrl-W-P to move back the sitemap file then "G" to take me to the end of the file and ran this macro:
:read top.n^MG$^Wpj0f"lyt"^Wpp:read end.n^MkJxG$
:read top.n^M I read-in the contents of the top.n file (^M represents the single character for Enter, don't try to copy this file as I've escaped all the special characters - better to make your own keyboard macro)

G$^Wpj0 - move the cursor to the end of the sitemap file and Ctrl-W-p (CTRL is ^W) to take me to the PageIndex file and then move down one line and to the beggining of the line.
f"lyt" - find the first quote on the line, move one character to the right and yank to the next quote (this simply copies the url of the file from the link).
^Wpp - Ctrl-W-p back to the sitemap file and put the yanked text (the url)
:read end.n^M - read in the contents of end.n
kJx - move up one line and join the next line, deleting the space.
G$ - move the cursor to the end of the file and end of the line, ready for the next itineration of the macro.

Of course the this macro was repeatable so I just typed:
300@a
and it simply itinerated down the list 300 times. (the macro was in the "a" register)
When it got to the "</ul>" at the end of the list of files, it just stopped the macro as there was no " on the line.

I had to modify top.n and end.n for each of the four sections (Diseases, Effects, Problems, and Techniques) but otherwise it was quite quick.

I indexed 955 files in all.

The last bits were easy, I just added the xml header and footer and the file was complete.

Originally it was over 130 kb so I turned it into a 7kb .gz (sitemap.xml.gz) and ftp'd it to the site. Then I used Google Webmaster tools to submit it to Google.

Done. I think.

Thursday, August 26, 2010

Vim wnext, and Macros for Multiple Files

I have finished the pages for the home section. Yipee!, praise God! Almost done.
But while I did these pages I found a few things I needed to change on all the other cards. The first two were warnings from the validator:
  1. My XHTML namespace declaration was invalid because I hadn't stated which language I was using. I needed to delete the whole line and insert a declaration that included xml:lang to denote the primary language of the page.
  2. Most of the tooltips had a space at the end of the title's value, just before the closing quote. I needed to delete them all.
  3. I needed to add a copyright notice on every page.
This meant at least two changes on every one of 988 files.... but thanks to Vim the whole thing took under an hour.

First I made two files and put them in the home directory:

lang.txt was
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

And copy.txt:
<p>© Copyright 2010 Bruce Thompson</p>

Then I moved into a section (eg. Diseases with 202 pages) and in the console:
gvim *.html

This started Vim editing all 202 html files in the directory and displayed the first file. I then recorded the following macro "@A":
/<html xml^Mddk:read ../lang.txt^MG?div^Mk:read ../copy.txt^M:%s/ ">/">/ge^M

/<html xml^Mdd Find the present namespace declaration (^M is Enter - didn't type it, just pressed Enter) and delete the line
k:read ../lang.txt^M - Move up one line and read the lang.txt file
G?div^M - Move to the end of the file and search backwards for the last closing div
k:read ../copy.txt^M - Move up a line (to where the copyright needed to be) and read in the copy.txt file.
:%s/ ">/">/ge^M - Substitute the attribute ending with the space for one without a space. The "g" flag means that it will substitute all the occurrences on the line but the "e" flag is essential in a multifile macro because this doesn't report an error when there is no occurence in a particular file (and therefore stop the macro repeating).

After I checked the file and validated it. I made a new macro "@B":
:wnext^M/<html xml^Mddk:read ../lang.txt^MG?div^Mk:read ../copy.txt^M:%s/ ">/">/ge^M

:wnext - Wrote the file and moved to the next file in the series then repeated what I had done in previous macro, "@A".

When this file validated correctly, I issued the following command
:200@b

This repeated the "@b" macro on the remaining 200 files in the directory.

I repeated this for each of the remaining three sections and had it all done in under an hour. So it is now finished... I've only got to find a place to host it.

Sunday, June 27, 2010

Vim Pagemaking Macro

Today is a high day. I finished making content pages (all the Hydrotherapy stuff) at 2.30 this afternoon. I wondered if it would ever end.
The numbers breakdown is:
Diseases: 202
Effects: 54
Problems: 437
Techniques: 295
Making a grand total of 988 pages.

The Vim pagemaker macro I used was:

/#card^Mf<"ly2f>:sp PageIndex.html^MG$o^[p:wq^Mj^"ty$j"fy$:sp ^Rf^M:read top.h^MG$"tp:read head.h^MkJxG$:read cont.h^MG$:read breadcrumb.h^Mj/<\/p>^Mh"tpG$"tpa</h1>^[^Wwjma/#end^Mkd'a^WWpG$:read rightbox.h^MG$:read badge.h^MG$:read bottom1.h^MG$:read col1.h^MG$:read bottom2.h^MG$:read col2.h^MG$:read bottom3.h^MG$:read col3.h^M/^Rf^M^faa class="here"^[G$:read footer.h^MG:w^M
To tease it out a bit we need to remember that the first three lines of the card "Visceral Congestion" were:
#card @<a href="VisceralCongestion.html">Visceral Congestion</a>
Visceral Congestion
VisceralCongestion.html

And we need to know that:
"l = register L etc
^M = Enter
^[ = Escape
^W = Ctrl-W (for window navigation with a split screen)
^R = Ctrl-R (reads in the contents of following register)

The macro would start with the cursor in the previous card so:

/#card^Mf<"ly2f>:sp PageIndex.html^MG$o^[p:wq^M

will find the first line of the card, yank the link, <a href="VisceralCongestion.html">Visceral Congestion</a>, to Register L (Link) and append this link to the end of the Page Index file.
j^"ty$j"fy$:sp ^Rf^M

Then moving down to the second line (Visceral Congestion) then yanks it to Register T (Title). Then it moves down to the third line (VisceralCongestion.html), appends it to Register F (Filename) and splits to a window editing the file, VisceralCongestion.html.

:read top.h^MG$"tp:read head.h^MkJxG$:read cont.h^MG$

This starts the Visceral Congestion.html with the DTD and other HTML down to the <title> tag by "reading" in the contents of a file I had previously made called "head.h". It then puts the contents of Register T (Visceral Congestion) and moves to the end of the file (with G$) before reading in the contents of the file "cont.h" which takes us down to the top of the content of the file.

:read breadcrumb.h^Mj/<\/p>^Mh"tpG$"tpa</h1>^[

This reads in the breadcrumb navigation, which I made at the beginning of each section, and places the title at the end then completes the heading of page by placing the title in h1 tags.

^Wwjma/#end^Mkd'a^WWpG$

Using window navigation we return to the lower window containing the contents of the card, places Mark A (ma) on the first line of the file (just below the filename and searches for the end of the card. It then deletes the card's contents, navigates up a window puts the contents then moves to the end of the file.

:read rightbox.h^MG$:read badge.h^MG$:read bottom1.h^MG$:read col1.h^MG$:read bottom2.h^MG$:read col2.h^MG$:read bottom3.h^MG$:read col3.h^M

A long list of file with various HTML are read in at the end of the file, the last ones containing the site map at the bottom of the page. The "col" files had the contents of the map.

/^Rf^M^faa class="here"^[G$:read footer.h^MG:w^M

Once the contents of the site map were read in, the page's title needed highlighting with the class "here" and the footer file finished off the page.

I then opened the page in Firefox, corrected any obvious problems then validated it with Total Validator (6.3.0) as desktop tool.

Total Validator was great with British English spellchecking and accessibility validation as well as the expected HTML validation.

The whole process for one page without major problems took only a minute.

But now it's finished. Just the main index page and the messy stuff up the top of the site to write now.

Sunday, May 30, 2010

Tooltips with Vim Regular Expressions

Off the top of your head, can you define "anodyne" or "faradic"?

Probably not, but these and many more obscure words, occur throughout Traditional Hydrotherapy. To overcome the lack of knowledge of these terms I had made up a glossary. I now wanted to make this available easily to the reader of Traditional Hydrotherapy. The answer was in Tooltips.

To illustrate a tooltip just hover your mouse over anodyne or faradic. That box that springs up is a tooltip and exactly what I needed... a simple way to get the definition to the reader.

The code for the "anodyne" tooltip looks like this:

<span title="a treatment to relieve pain">anodyne</span>

Problems presented themselves immediately, and, as always, Vim was up to the task.

This is the text from the glossary file (made under DOS with PCWrite):

#card @faradic
electric current used mainly for stimulating innervated muscle, consists of pulsed DC current
#end

Problem: I had to turn the definition into a single line.
Answer: Use "J", which appends the following line with a space in between.

Second Problem: These words are often part of larger words and I didn't want to chop words up.
Answer: Use the Vim regular expressions:
Word Beginning, "\<", and Word End, "\>".

This way I would be able to make tooltips around whole words only.

Thirdly: how do I substitute the text for both upper and lowercase occurrences, "Faradic" and "faradic"?

The answer is two macros that begin on the "#card" in the glossary file, glos.txt and split to a single file which contained all four html files (appropriately called "big.html" as it ended up at over 3Mb:

@G - which deals with lowercase version

then @M which does the tooltips for the upper-case and also deals with words in the titles of pages.

and @N a final macro that corrects some of the changes @M made and goes to the next card in the glossary.

Let's have a look at the macros:
@G
/@^Ml"tyEj^"dy$:sp big.html^M:%s+\<^Rt\>+<span title="^Rd">^Rt</span>+gc^M
/@^M -search for "@"
l"tyE - move right one (onto the first letter of the title) and yank to End of the word into register "t"
j^"dy$ - move down one line and to the beginning of the word then yank to end of line into register "d"
:sp big.html^M - split screen and open into the file containing all the html
:%s+\<^Rt\>+<span title="^Rd">^Rt</span>+gc^M
:%s+\<^Rt\>+^Rt+gc^M - the business substitution - using Word Beginning, "\<", and Word End, "\>", this is to prevent words as part of URLs being substituted. The registers are called using the "-R (register letter)" form. The substitution is for all occurrences on a line and "c"hecks. so I can be sure it is going OK.


@M
^Wpk/@^Ml~h"lyE^Wp:%s+^Rl.html+LL^Rl.html+ge^M:%s+\<^Rl\>+<span title="^Rd">^Rl</span>+gc^M
^Wp - return to the previous window (glos.txt) with -W p
k/@^M - move up a line and search for "@"
l~h - move one letter to the right and change the case of the letter (to capitalise)
"lyE^Wp - yank to end of the word into register "l" and return to the previous window (big.html)
:%s+^Rl.html+LL^Rl.html+ge^M - a substitution to add "LL" to the beginning of the word if it is a filename and thus preventing it being changed.
:%s+\<^Rl\>+<span title="^Rd">^Rl</span>+gc^M - much the same as the substitution in @G except using register "l" instead of "t"

@N
:%s+LL^Rl+^Rl+ge^M:wq^Mj/#card^M
:%s+LL^Rl+^Rl+ge^M - a substitution to remove the, now unneeded "LL" notice the "e" tag which means it doesn't stop on an error (usually where the LL doesn't exist because there were no pages to be made with that filename)
:wq^M - write and quit the big.html file
j/#card^M - now in glos.txt, move down a line and search for the next occurrence of "#card" (for the next word)


Using these files I managed to add tooltips to about 200 words in my spare time last week.

Now to make all those files (and validate them).

Monday, April 5, 2010

CSS Compliant Facebook Badge

I made a Fan Page for Traditional Hydrotherapy. There is nothing on it yet, I just needed to get a URL so I could finish my page layout. I decided to place a Facebook badge for this page in the right column of the website's pages if there was nothing else to go there.

When I created a badge the Facebook way. I ended up with this HTML to put on each page:
<!-- Facebook Fan Badge START -->
<div style="width: 100%;">
<div style="background: #3B5998;padding: 5px;">
<img src="http://www.facebook.com/images/fb_logo_small.png" alt="Facebook"/>
<img src="http://badge.facebook.com/badge/111459758873296.100000637781892.2048613001.png" alt="" width="0" height="0"/>
</div>

<div style="background: #EDEFF4;display: block;border-right: 1px solid #D8DFEA;border-bottom: 1px solid #D8DFEA;border-left: 1px solid #D8DFEA;margin: 0px;padding: 0px 0px 5px 0px;">

<div style="background: #EDEFF4;display: block;padding: 5px;">

<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top"><img src="http://www.facebook.com/images/icons/fbpage.gif" alt=""/></td>
<td valign="top">
<p style="color: #808080;font-family: verdana;font-size: 11px;margin: 0px 0px 0px 0px;padding: 0px 8px 0px 8px;"><a href="http://www.facebook.com/people/Bruce-Thompson/100000637781892" title="Bruce Thompson" target="_TOP" style="color: #3B5998;font-family: verdana;font-size: 11px;font-weight: normal;margin: 0px;padding: 0px 0px 0px 0px;text-decoration: none;">Bruce Thompson</a> is a fan of</p>
</td>
</tr>
</table>
</div>

<div style="background: #FFFFFF;clear: both;display: block;margin: 0px;overflow: hidden;padding: 5px;">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="middle">
<a href="http://www.facebook.com/pages/Traditional-Hydrotherapy/111459758873296" title="Traditional Hydrotherapy" target="_TOP" style="border: 0px;color: #3B5998;font-family: verdana;font-size: 12px;font-weight: bold;margin: 0px;padding: 0px;text-decoration: none;">
<img src="http://www.facebook.com/profile/pic.php?oid=AAAAAwAgACAAAAAPnFSoNc8Trl6ORItfDTJhYKYveiENe4kqugsRcDaZtA5_f_aRwFLP_WeddB9Cb9kck-0FC-b94fEd8ed_T_OwQCrjqZ_8mijIMwVS7kGeT7K_tbEyj2S2RzD0BrqH-a2o&size=square" style="border: 0px;margin: 0px;padding: 0px;" alt="Traditional Hydrotherapy"/>
</a></td>
<td valign="middle" style="padding: 0px 8px 0px 8px;">
<a href="http://www.facebook.com/pages/Traditional-Hydrotherapy/111459758873296" title="Traditional Hydrotherapy" target="_TOP" style="border: 0px;color: #3B5998;font-family: verdana;font-size: 12px;font-weight: bold;margin: 0px;padding: 0px;text-decoration: none;">Traditional Hydrotherapy
</a></td>
</tr>
</table>
</div>
</div>
</div>
<!-- Facebook Fan Badge END -->

Which produces a badge that looks like this:


I thought the HTML was far too messy so decided to hack it and make an equivalent using CSS.

My CSS looks like this:
/*Facebook fan page badge */
#fbbadgetop{
width: 100%;
background: #3b5998;
padding: 5px;
bottom:40;
}
#fbbadgemid{
background: #edeff4;
display: block;
border-right: 1px solid #d8dfea;
border-bottom: 1px solid #d8dfea;
border-left: 1px solid #d8dfea;
margin: 0px;
padding: 0px 0px 5px 0px;
}
#fbbadgecont{
background: #ffffff;
clear: both;
display: block;
margin: 0px;
overflow: hidden;
padding: 5px;
}
#fbbadgecont a{
border: 0px;
color: #3b5998;
font-family: verdana;
font-size: 12px;
font-weight: bold;
margin: 0px;
padding: 0px;
text-decoration: none;
}
#fbbadgecont p{
padding-top: 5px;
}
.align-left{ float:left; margin: 0 15px 0 0; }

The HTML looks like this:
<div class="rightbox">
<div class="product_wrapper">
<p>Become a fan at...</p>
<div id="fbbadgetop">
<img src="../images/fb_logo_small.png">
</div>
<div id="fbbadgemid">
<div id="fbbadgecont">
<a href="http://www.facebook.com/pages/Traditional-Hydrotherapy/111459758873296" title="Traditional Hydrotherapy" target="_TOP"><img src="../images/fbtartan.jpeg" class="align-left"></a>
<p><a href="http://www.facebook.com/pages/Traditional-Hydrotherapy/111459758873296" title="Traditional Hydrotherapy" target="_TOP">Traditional Hydrotherapy</a></p>
</div>
</div>
</div>
</div>

And the new badge is:

I'm quite pleased with this but I'm sure that there are plenty of people who can make it even lighter. Or maybe I should just turn it into a png image...

Which would be lighter and faster? Please let me know.

And this whole exercise begs the question...WHY?

Well the simple answer is that I don't want the validator going off with every page I make. (and I love messing around with stuff).

Monday, March 22, 2010

HTML Finished!

Yep, I finished the most draining part so far yesterday morning.

Now I have just four files
Diseases.html   586,302 kb
Effects.html    138,709
Problems.html   753,148
Techniques.html 519,271
Total.........1,997,430

That's nearly 2 Mb... a whole lot of typing!

It was great to have this over. Pretty boring and repetitive, so will probably be riddled with mistakes.

Thanks Steve and other LOGIN folks for the suggestion of HTML Tidy to fix these mistakes. It sounds great but isn't in the Vector repositories. Maybe I'll package it up as I will have to do most of it to install anyway It looks like a fairly straight-forward thing, not too many dependencies.

Next steps in Traditional Hydrotherapy:
1. Getting a valid sample page up.
2. Installing (packaging?) HTML tidy
3. Working out how to quickly create web pages - no doubt it will be those Vim macros again.
4. Seeing how to integrate Vim and HTML tidy (I've got a Vim addon - never used one for Vim).
5. That' enough for now.

Sunday, March 7, 2010

Vim Keyboard Macros for HTML Lists

Traditional Hydrotherapy is mainly lists. To complete marking up these lists I am using a few macros:

@r to replace the "/li" at the start of a list with "ul" on the first line of the list and thus start an unordered list. (From a previous post you will know that the dash (-) bulleted lists now have "</li><li>" instead of the dash.)
:s+/li+ul+^Mj
This is a simple substitution and I used "+" to delimit it as the usual "/" is used in the "from" string. It means:
:s+/li+ul+ - on this line substitute "ul" for "/li"
^Mj - <Enter> and move the cursor down a line

@e To end the unordered list, on the line after the last list item:
O</li></ul>^[j
O</li></ul> - open a line above the cursor, change to Insert mode and insert "</li></ul>"
^[j - <Escape> to Normal mode and move the cursor down a line, to where it was.

@b - for a one-line unordered list
@r@e
Simply a combination of the two previously shown macros.

The two macros, "@r" and "@e", were all I needed to finish marking up lists that had the list-items marked. But there are still lists without any markup, many of them the big Section indexes. For these unmarked lists I used "@e" from above and:

@u start an unordered list, called on the first item of the list:
I<ul><li>^[j
I<ul><li> - Open insert mode at the beginning of the line and insert the markup that starts an unordered list and the first list item
^[j - Escape back to normal mode and move down a line

@l To put "</li><li>" at the beginning of lines:
I</li><li>^[j
I can repeat this for all the remaining list item lines by typing, for instance "10@l" for a list with ten more list items.

@o - unordered list with a single list item. (start on line)
@u@e
This simply calls two previously mentioned macros, one starts the list the other ends it.

@d - for a two-list item unordered list (which I seem to have lots of):
@u@l@e
In the same vein as "@o" and "@b", above, this macro calls three previous macros

@c to markup comma separated lists. I'm dealing with a lot of these in Techniques.
f,2xi^M</li><li>^[
This finds the next comma, deletes it and the following space, start Insert mode and <Enter> to move the remainder of the line down one line and mark it up as a list item, then escape back to Normal mode

I have a question out of this, maybe you can answer. Is there any way of simply pushing the remainder of a line down onto a new line the way that <Enter> does in Insert mode?

And finally today, before I get back to work.

@m - To delete a number and fullstop (or dash and space), and put in regular list-item markup:
^2x@l

This moves the cursor to the first character of the line, deletes 2 characters and calls @l, the list-item macro.

HTML Markup with Vim Macros

So after the last post I had four files:

  1. Diseases.txt
  2. Effects.txt
  3. Problems.txt
  4. Techniques.txt

They had all their links marked up in html and all the bullet points converted to html list items. Now I had the daunting task of marking up the rest of the html.

To make markup easier I turned on Vim's syntax highlighting by simply changing the filenames to .html like this:

  1. Diseases.html
  2. Effects.html
  3. Problems.html
  4. Techniques.html

My present job is going through each of these files and manually marking up the html. Once again Vim macros have come to the fore. As I found previously the edits were quite slow on the bigger files, so split them into smaller ones. At present I am making good progress having completed Diseases, Effects and Problems in the last month and must be about halfway through Techniques.

So here is how I'm using the macros for general html tags:

@h - To make subheadings "H3"
I<h3>^[A</h3>^[j
I<h3>^[ - move to beginning of line, change to Insert mode, insert "<h3>" to begin the heading, then <Escape> to Normal mode
A</h3>^[j - start Insert mode after the last character on the line, Insert "</h3>" to end the heading, <Escape> to Normal mode and move the cursor down a line (to begin the next macro)

@p for a one-line paragraph
I<p>^[A</p>^[j
This is the same as "@h" above, except the paragraph markup is inserted. To ensure that paragraphs are one-line, I use "J", which appends the next line to the end of the present line with a space between.

@t - inserts treatment heading - often missing in Diseases
O<h3>Treatment:</h3>^[j
This opens a line above the cursor into Insert mode and insert the treatment heading then <Esc> back to Normal mode and move the cursor down a line.

I use other substitutions to make headings as well, like:
:%s+^Prevention:+<h3>Prevention<\/h3>+
and
:%s+Indications:+<h3>Indications:-</h3>+
And to get rid of redundancy in the links in the Diseases.html file:
:%s+../Diseases/++g

Sunday, February 14, 2010

Vim Substitution to make List Items

As you can see from the Hyperhelper code, most of my lists used "-" as the bullet.

I used "substitution" to mark these all up as List Items (ie <li> </li>).
Substitution is a command-mode command with this form:
:<range>s/<from>/<to>/
Pretty simple and we have come across it before.
So to convert "- lists to HTML, I used:
%s+^- +</li><li>+
That is:
%s - over the whole file substitute
+ - I used "+" as a delimiter instead of the usual "/" because the slash appeared in the body of the substitution (</li>), but I could have escaped it with \/
^- + - (the "from" part of the substitution) the caret is a regular expression meaning that the search is for the pattern (in this case a dash followed by a space (- ) are the first characters on the line.
</li><li>+ - the "to". This configuration (the closing tag preceding the opening tag) is effective in closing previous list-item line and I can then simply substitute the initial closing tag with the <ul> tag to start a list. Otherwise it is all good.

If you look carefully at the Hyperhelper code, you will notice that I nested list with spaces. Subpoints were indented a space or two). To use this to effectively nest my HTML lists, I needed to simply add a space to the "from" and "to" fields of the substitution and repeat it.

The interesting thing about substitution is that it shows the number of substitutions it makes. I recorded these so I can tell you that there are a grand total of 8,034 bulleted list items in the whole of Traditional Hydrotherapy. Even though some lists are not bulleted, I would have expected more. In any case it has taken longer to write about this than it actually took to do it. Substitution is much faster than macros! The whole process was done in under an hour

So here are my substitutions followed by the number of substitutions in each of the files

%s+^- +</li><li>+
Problems: 1726 Diseases:2098 Effects:314 Techniques:186 Total: 4324
%s+^ - + </li><li>+
Problems: 1259 Diseases:1096 Effects:158 Techniques:348 Total: 2861
%s+^  - +  </li><li>+
Problems: 213 Diseases:219 Effects:32 Techniques:49 Total: 513
%s+^   - +   </li><li>+
Problems: 91 Diseases:154 Effects:8 Techniques:30 Total: 283
%s+^    - +    </li><li>+
Problems: 12 Diseases:30 Effects:0 Techniques:11 Total: 53,
Grand Total: 8,034

Quotes Headings with Vim Macros and Substitutions

Even though I had completed the Quote Index, in the pages the headings were not marked up. To do this I used both macros and substitute. Once again the substitute was much faster.

What was in the text file was:

#quote Dr Kellogg says...
#qhead Hydrotherapy Departments

The most elegantly equipped establishment for the administration
of hydriatic procedures may be only the means for bungling and
unscientific dabbling with human ailments, unless conducted under
skilled medical direction and by the aid of attendants well
trained in the versatile procedures of hydrotherapy. p 402
#end

I wanted to change it into:
<h4>Dr Kellogg says...<h4>
<h4>Hydrotherapy Departments</h4>
<p>The most elegantly equipped establishment for the administration
of hydriatic procedures may be only the means for bungling and
unscientific dabbling with human ailments, unless conducted under
skilled medical direction and by the aid of attendants well
trained in the versatile procedures of hydrotherapy. p 402</p>
#end

After searching for Quotes (with "/#quote") If there was a heading I would use "@g", if there was no heading (ie. it was the same as the card title) I used "@x"

"@g" - make a H4 heading for the quote IF there is a heading and finish </p> after

j^2dwi<h4>~@@7</h4>^[j^i<p>^[
That is:
j^ - move the cursor down one line and to the first character on the line (ie. to the hash in #qhead)
2dw - delete two words (# and head)
i<h4> - change to Insert mode and insert the text <h4>
~@@7</h4> - <End> to move to the end of the line and insert the text </h4>
^[j - <Esc> out of Insert mode, back to Normal mode and move cursor down a line (to the body of the quote)
I<p>^[ - open Insert mode before the first character on the line and start the paragraph by inserting <p>

"@x" where there is no #qhead given, (it finds the card title and inserts it)
o^[ma?#card^Mj"zy$'apI<h4>~@@7</h4><p>^[
o^[ma - open a line below the #quote line, <Esc> to get back to normal mode and set line as "mark a"
?#card^M - search backwards for #card <Enter>
j - move down a line to the page title
"zy$ - into "register z" yank (copy) everything to the end of the line (ie the whole title)
'ap - move back to mark a (under the #quote line) and "put" the copied text (the card title)
I<h4> - before the first character of the line Insert the text <h4>
~@@7</h4><p>^[ - <End>, insert the text "</h4><p>" then <Esc> back to Normal mode

And finally: (and it was much, much faster as it was a straight-forward substitution to mark up the Quote heading)
%s/#quote Dr Kellogg says.../<h4>Dr Kellogg says...<h4>/

All up, this process took an hour.