I need sugestion terminal based word procesor like nano but can save file as RTF usind UTF8 code page for latin II

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

User avatar
puppy_apprentice
Posts: 680
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 4 times
Been thanked: 110 times

Re: I need sugestion terminal based word procesor like nano but can save file as RTF usind UTF8 code page for latin II

Post by puppy_apprentice »

I don't want to convince you to my style of writing, but you can write for dialogs this:

Code: Select all

- Hello, my name is Zuzia.
- Hello, my name is puppy_apprentice, nice to meet you.

And before you convert text to HTML you can replace all '-' to '\-', every editor have replace function ;). Some editors have possibility to make macros that will do some stuff automatically.

williwaw
Posts: 1874
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 167 times
Been thanked: 345 times

Re: I need sugestion terminal based word procesor like nano but can save file as RTF usind UTF8 code page for latin II

Post by williwaw »

when using a text editor such as joe for composing, what is the easiest way to save or convert a file to..

1. rtf?
2. html?

User avatar
puppy_apprentice
Posts: 680
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 4 times
Been thanked: 110 times

Re: I need sugestion terminal based word procesor like nano but can save file as RTF usind UTF8 code page for latin II

Post by puppy_apprentice »

HTML
a) plain text you can write directly in editor using this template:

Code: Select all

<html>
<meta charset="UTF-8">
<title>You title</title>
<body>
<pre>
Your text
</pre>
</body>
</html>

b) for more complex text you have to use markdown:

Code: Select all

# First Level Headline

Another First Level Headline
=========================

## Second Level Headline

Another Second Level Headline
--------------------------

Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.

## Something in Polish
Pójdźże, kiń tę chmurność w głąb flaszy!
Żółty słoń nie ma jak usiąść na tępych gwoździach.
Zażółć gęślą jaźń.

### Third Level Headline

> Citation Block.
>
> Second acapite in Citation Block
>
> ## Second Level Headline in Citation Block

Now to convert this into HTML you have to use some converter. It could be offline eg. Pandoc or Writeup, or online eg. Pandoc or MD-2-HTML
Paste converted text into *** position in this template:

Code: Select all

<html>
<meta charset="UTF-8">
<title>Markdown to HTML</title>
<body>
***
</body>
</html>

RTF
Use Pandoc or online converters to convert above markdown example.
Add this as a first line to converted text:

Code: Select all

{\rtf

Try to open file with .rtf extension in AbiWord.

User avatar
6502coder
Posts: 90
Joined: Mon Jul 13, 2020 6:21 pm
Location: Western US
Has thanked: 3 times
Been thanked: 22 times

Re: I need sugestion terminal based word procesor like nano but can save file as RTF usind UTF8 code page for latin II

Post by 6502coder »

I have taken puppy_apprentice's nice template and expanded it into a script that automates the process of converting a Jstar document into an HTML document.

Download the attached script "star2html.gz" and place it in your ~/my-applications/bin folder.

Remove the fake ".gz" extension and make sure that the script is executable. To do this, open a terminal session in the folder where you placed the script, and give the commands:

Code: Select all

# mv  star2html.gz  star2html
# chmod  gou+x  star2html

Full instructions are in the script itself, but the basic usage is

Code: Select all

# star2html  "Casino Royale"  jamesbond1.txt

where the first argument is for the HTML document title, and the second argument is the Jstar document. The output file will be "jamesbond1.txt.html"

Let me know of any bugs or desired improvements.

Attachments
star2html.gz
rename to remove fake ".gz" extension
(1.6 KiB) Downloaded 19 times
Post Reply

Return to “Users”