nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Add HTML Code Inside HTML File

This is a discussion on Add HTML Code Inside HTML File within the Coding in General forums, part of the Development/Scripting category; hey all.. i am building a new simple website in basic html codes. my website explains about how to build ...


Go Back   nixCraft Linux Forum > Development/Scripting > Coding in General

Linux answers from nixCraft.


Coding in General Discussion on PHP/Perl/Python/Ruby/GNU C or C++. MySQL, PgSQL and (X)HTML or any other programming languages you want.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-11-2008, 01:07 AM
eawedat's Avatar
Senior Member
User
 
Join Date: May 2008
Location: Palestine
OS: Kn0ck3D
Posts: 138
Thanks: 1
Thanked 2 Times in 2 Posts
Rep Power: 2
eawedat is on a distinguished road
Send a message via MSN to eawedat
Lightbulb Add HTML Code Inside HTML File

hey all..
i am building a new simple website in basic html codes.
my website explains about how to build a websites in html codes.

now..
the hard question is
how to view the html codes as a sentences(explanations) and not consider them as codes to process.

for example..
page index.html will include the explaination below :

Hello people now we are starting the first thing to do
which to write the code <html>

-------------

now if i write the command <html> inside the html website it considers it as a code . i need to consider it as a normal typing,, as a sentence/word.

thanks.
Reply With Quote
  #2 (permalink)  
Old 02-11-2008, 01:49 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

You need to use command such as highlight to convert html code so that it can be displayed on screen.
Code:
highlight -i input.html -o output.html -S php
Another option is write code as follows inside <pre>..</pre> or <code>..</code> tags:
Code:
<html>
<head>
<title>This is a test</title>
</head>
<body>
<h1>This is a test</h1>
Let us see how to create a html page:
<pre>
    &lt;html&gt;
    &lt;head&gt;
    &lt;title&gt;First HTML Page&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;h1>First HTML Page&lt;/h1&gt;

    &lt;/body&gt;
    &lt;/html&gt;
</pre>
</body>
</html>
I suggest following site for basic tutorials and as usual our forum will be help
W3Schools Online Web Tutorials
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 02-11-2008, 01:20 AM
eawedat's Avatar
Senior Member
User
 
Join Date: May 2008
Location: Palestine
OS: Kn0ck3D
Posts: 138
Thanks: 1
Thanked 2 Times in 2 Posts
Rep Power: 2
eawedat is on a distinguished road
Send a message via MSN to eawedat
Default hey

the second works,
but the first one i did not understand where to put that command
it seemed to me that i should type it in linux
but the highlight command not found.

thanks
Reply With Quote
  #4 (permalink)  
Old 02-11-2008, 06:03 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

You need to install hightlight command using apt-get or yum.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #5 (permalink)  
Old 05-11-2008, 02:53 PM
DragonMaster's Avatar
Junior Member
User
 
Join Date: Oct 2008
OS: Debian, Ubuntu Kubuntu
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
DragonMaster is on a distinguished road
Default

Wow, highlight sounds brilliant - not tried it yet, but the documentation page at GNU Source-highlight 2.10 makes it look very interesting - to think that I may have wasted so much time re-formatting my <pre> code...
Reply With Quote
  #6 (permalink)  
Old 05-11-2008, 05:53 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
Originally Posted by DragonMaster View Post
Wow, highlight sounds brilliant - not tried it yet, but the documentation page at GNU Source-highlight 2.10 makes it look very interesting - to think that I may have wasted so much time re-formatting my <pre> code...
Do you use any specific CMS software like Drupal or Wordpress? If so search for plugin / addon which does the same thing without using command line. Then there is famous GeSHi for php:

Quote:
GeSHi aims to do this all as quickly as possible. Many customisable features of GeSHi facilitate speed increases, and you can easily find a balance between the amount of highlighting done and the speed in which it is done.

GeSHi supports PHP5 and Windows, and has even been used to highlight code on ASP pages. Numerous blogs, wikis and forums use GeSHi, including Dokuwiki, Mambo, phpBB and WikkaWiki.
GeSHi - Generic Syntax Highlighter :: Home
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
Reply

Tags
highlight , html code , shell script html , sourcecode to formatted


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to follow symlink on /var/www/html demuytree Shell scripting 0 15-10-2008 11:05 PM
Script to strip all slack from php, html, js meowing Shell scripting 4 03-05-2008 02:37 AM
Perl simple html mail chiku Coding in General 3 17-08-2007 07:59 PM
HTML variable nathan86 Linux software 3 23-03-2005 12:29 PM
HTML Program cannot open in cgi-bin folder sonaikar Linux software 5 04-02-2005 04:45 PM


All times are GMT +5.5. The time now is 11:20 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38