How to Show HTML Code on Associated Content Articles

Robert Mann
It is possible to show HTML content in Associated Content articles, though the process is somewhat tortuous. The key ingredients are a determination that HTML code must be displayed in your writing and an ability to follow detailed steps.

We will begin with a caveat: Each time you return to the text editor after passing that step, all your HTML code is changed into the actual objects represented. Thus you must copy and paste your source code into a text program like Windows Notepad each time you leave the text editor. When you return for further editing, access the source code and copy and paste your information from the text program back into the AC text editor.

1. Write your article in Word or another Word Processor using regular HTML symbols for code examples, then use the appropriate paste function to move the content to the AC text editor. Next switch to the source view of your document. The source view will be your interface from now on.

2. For overall presentation, all HTML code must be presented as preformatted text. To accomplish this, place your code samples inside the following tags:

<pre> and 

I would recommend doing this as you go along as some steps are blended into others.

3. Use the entities for HTML symbols rather than the actual symbols. For instance, the less-than symbol would be written &-l-t-; (minus the hyphens). Most likely these entities will already be present in the source code after you paste.

4. Here is where things get weird: When using the less-than (&-l-t-;) and ampersand (&-a-m-p-;) entities, leave off the final semicolon. If the semicolon is left in place, the code will be translated. When you leave off the semicolon, the AC text editor automatically fixes the missing item but the HTML is still rendered as code. This does not apply to other symbols.

5. Anytime a code sample is given, the AC text editor automatically inserts a break after the code, which would be after the closing preformatted text tag. Thus you must append your next line to the end of the code sample in order to get a regular double-space break.

6. Because of the automatic break, presenting HTML code within a paragraph will split the paragraph, so it is best to present all examples in their own line.

7. When your article is published, lines of code do not wrap, so it is important to break up long lines of code or other content is pushed off of the AC page. Lines of code should be no longer than the width of wrapped text in an article. This can take some trial and error as you edit your article.

8. As stated before, editing an article with HTML code samples is a one shot deal. Thus you must copy and paste from a text program into the AC source code editor each time you revise your document, and vice versa when you are done.

Happy publishing! And remember that missing any detail in the previous steps could result in your code either being translated or not appearing at all. For an example of HTML code being displayed on Associated Content, visit the following HTML tutorial.

Published by Robert Mann

Corporate trainer and Website developer who has been published across diverse genres of writing. Early published works include poetry and college-level grammar workbooks. Additional articles published includ...  View profile

1 Comments

Post a Comment
  • theBarefoot3/17/2008

    and yet AC screwed up the presentation anyway. Valiant effort my friend.

To comment, please sign in to your Yahoo! account, or sign up for a new account.