Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 17 Nov 2019, 07:17
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Two columns in leafpad or geany ??
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 6 [84 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Author Message
wiak

Joined: 11 Dec 2007
Posts: 1830
Location: not Bulgaria

PostPosted: Sun 28 Apr 2019, 08:53    Post subject:  

I suspect you can arrange JOEs editor to display two columns, but I'm not sure:

https://joe-editor.sourceforge.io/

Anyway, lots of editors of all kinds can be found at site I suggested here:

http://www.murga-linux.com/puppy/viewtopic.php?p=1026561#1026561

wiak

_________________
Tiny Linux Blog: http://www.tinylinux.info/
Check Firmware: www.murga-linux.com/puppy/viewtopic.php?p=1022797
tinycore/slitaz: http://www.murga-linux.com/puppy/viewtopic.php?p=990130#990130
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14474
Location: Gatineau (Qc), Canada

PostPosted: Sun 28 Apr 2019, 10:31    Post subject:  

wiak wrote:
I suspect you can arrange JOEs editor to display two columns, but I'm not sure:(...)
wiak
Yep.

Two columns in the Joe Editor:

http://www.murga-linux.com/puppy/viewtopic.php?mode=attach&id=122995

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5623
Location: Republic of Novo Zelande

PostPosted: Mon 29 Apr 2019, 02:58    Post subject:  

Sorry all, I'm getting a bit behind here. I will try to catch up. Some neat suggestions and i am keen to try them all.
cheers!
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5623
Location: Republic of Novo Zelande

PostPosted: Mon 29 Apr 2019, 05:37    Post subject:  

fredx181 wrote:
here's another possible way using pure html (no markdown) as I think the "table" thing is not exactly what you want.
Inspired by proposed solution using <textarea> here (thanks 6502coder !):
http://murga-linux.com/puppy/viewtopic.php?p=1023403#1023403
At top of script you can change the text to display for left and right column.
Running it will create out.html
Thanks Fred and 6502, i gave this a try and it's pretty good. I tinkered around and made some changes - reduced pixel padding and changed table to "variable" and modified the ratio of "Work" width to "Personal" width to give more room for the work list.
(Also got rid of the "Work" and "Personal" headers as I don't really need them)

Here is the result:
Code:
# create out.html with textarea from COLUMN1 and COLUMN2
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<style>
textarea {
   width: 100%;
}
table {
  width: 100%;
  margin: 1px auto;
  table-layout: variable;
}

table,
td,
th {
  border-collapse: collapse;
}

th,
td {
  text-align: center;
}
</style>
<body>
   
<table>
<tbody>
<tr>
    <td><textarea cols="80" rows="100">
'"$COLUMN1"'

</textarea></td>
    <td><textarea cols="60" rows="100">
'"$COLUMN2"'

</textarea></td>
</tr>
</tbody></table>

</body></html>
' > out.html
Fred6502Mod.jpg
 Description   
 Filesize   30.42 KB
 Viewed   265 Time(s)

Fred6502Mod.jpg

Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14474
Location: Gatineau (Qc), Canada

PostPosted: Mon 29 Apr 2019, 11:30    Post subject:  

Hi greengeek.

You typed that in Firefox directly using fredx' template?
You didn't need an html editor?

BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5623
Location: Republic of Novo Zelande

PostPosted: Mon 29 Apr 2019, 11:53    Post subject:  

musher0 wrote:
Hi greengeek.

You typed that in Firefox directly using fredx' template?
You didn't need an html editor?
Yes and No.

Yes - the template script is all that is required.

No - an HTML editor is not required. The script automatically builds the webpage with two columns, ready for the users typed information to be dumped into each column.

No - I did not type the list data into the columns. The script contains two "variables" eg: "COLUMN1" and "COLUMN2" which contain all of the text to be included in each column. At the moment Fred typed all that text into the script, but the intention seems to be that each working day I would type new data into the variables before running the script - and that would update the columns.
(EDIT - you can see that column data in Freds examples on previous pages but i left it out of the snippet in my previous post just to improve visual clarity of my script alterations)

However - I would think that the possibility exists for the script to 'reference' data from other files rather than me having to open the script and edit the data directly. So potentially I could have a "WorkToDo" text file, and also a "PersonalToDo" text file and the script would populate the two COLUMN variables with the contents of each file as appropriate.

The biggest issues I have with this html approach are:
- it's a bit longwinded (but i am sure that can be improved as i get used to it)
- when i print the list from the browser i seem to have inadequate control of margins which brings me back to my initial problem of trying to avoid wasted whitespace on my daily job sheet.

On the other side of the coin - the best part of the html approach is the portability - i should be able to view the list on all sorts of devices.
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14474
Location: Gatineau (Qc), Canada

PostPosted: Mon 29 Apr 2019, 12:18    Post subject:  

Thanks for the explanation, g\g.
_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 4159
Location: holland

PostPosted: Mon 29 Apr 2019, 12:52    Post subject:  

Hi greengeek, perhaps the most convenient is (instead of having to edit a script everytime) is to source a file on top of the script containing your notes, say create "/root/mynotes.txt" for example with contents:
Code:
# mynotes.txt

# textarea for left column
COLUMN1='
1) Line 1
2) Line 2
3) Line 3
4) Line 4
5) Line 5
6) Line 6
'
# textarea for right column
COLUMN2='
1) Line 1
2) Line 2
3) Line 3
4) Line 4
5) Line 5
6) Line 6
7) Line 7
'

Then source it on top of script:
Code:

# source /root/mynotes.txt to get the the COLUMN1 and COLUMN2 variables
. /root/mynotes.txt

# create out.html with textarea from COLUMN1 and COLUMN2
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
.....
.....
.....
' > out.html


Then just edit the mynotes.txt file, click on the script and done.

Fred

_________________
Dog Linux website
Tinylinux blog by wiak
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5623
Location: Republic of Novo Zelande

PostPosted: Tue 30 Apr 2019, 05:22    Post subject:  

fredx181 wrote:
Then just edit the mynotes.txt file, click on the script and done.


I have decided to do it in a similar but slightly different way.

I will maintain my work list in a file such as ToDoWork.txt and my personal list in a file such as ToDoPersonal.txt - these will be simple leafpad files.

I have made a gtk gui which allows each of those files to be selected.

Then the user can save the html output as the default name (or they can modify the file name as desired).

The current date/time stamp is appended to the ToDo list html output file.

Remove the fake .gz suffix, make executable and click on the gui script.

Thanks all for the help!
(And please give me any other suggestions for ways to build a two pane ToDo list. cheers!)

EDIT : Newer version of this gui is available four posts further down
ToDo_HTML_gui_gg-0.1.gz
Description  *** Deprecated - Better to use version 0.2 further down the page ***
gz

 Download 
Filename  ToDo_HTML_gui_gg-0.1.gz 
Filesize  3.5 KB 
Downloaded  52 Time(s) 
gui_screenshot.jpg
 Description   
 Filesize   25.86 KB
 Viewed   195 Time(s)

gui_screenshot.jpg


Last edited by greengeek on Sat 04 May 2019, 13:15; edited 4 times in total
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5623
Location: Republic of Novo Zelande

PostPosted: Tue 30 Apr 2019, 05:30    Post subject:  

Oh darn. The html output does not respect the line feeds present in the leafpad files. More testing required.
(EDIT - converting the LF to CR/LF windows style seems to improve the problem. Don't like using windows syntax though Sad )
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1925
Location: Japan

PostPosted: Tue 30 Apr 2019, 09:11    Post subject:  

Recently Smithy has unearthed RtfEdit, a lightweight editor that should do what you want. When you activate the table tools from the toolbar menu you will be able to create a 2-column table. Text in each cell will be word wrapped within the cell without affecting other cell(s).
RtfEdit.png
 Description   
 Filesize   26.74 KB
 Viewed   207 Time(s)

RtfEdit.png

Back to top
View user's profile Send private message 
6502coder


Joined: 23 Mar 2009
Posts: 649
Location: Western United States

PostPosted: Tue 30 Apr 2019, 12:39    Post subject:  

greengeek wrote:
Oh darn. The html output does not respect the line feeds present in the leafpad files. More testing required.
(EDIT - converting the LF to CR/LF windows style seems to improve the problem. Don't like using windows syntax though Sad )

In your script you have
Code:
STARTTIME=$(echo `date +%Y-%m-%d_%H%M%S`)
#gxmessage "start time = $STARTTIME"

COLUMN1=$(echo `cat "$LEFTCOLUMNTEXTFILE"`)
COLUMN2=$(echo `cat "$RIGHTCOLUMNTEXTFILE"`)

Remove the echo stuff so it looks like
Code:
STARTTIME=`date +%Y-%m-%d_%H%M%S`
#gxmessage "start time = $STARTTIME"

COLUMN1=`cat "$LEFTCOLUMNTEXTFILE"`
COLUMN2=`cat "$RIGHTCOLUMNTEXTFILE"`
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5623
Location: Republic of Novo Zelande

PostPosted: Wed 01 May 2019, 01:13    Post subject:  

6502coder wrote:
Remove the echo stuff so it looks like
Code:
STARTTIME=`date +%Y-%m-%d_%H%M%S`
#gxmessage "start time = $STARTTIME"

COLUMN1=`cat "$LEFTCOLUMNTEXTFILE"`
COLUMN2=`cat "$RIGHTCOLUMNTEXTFILE"`

Thanks! Yes that corrected the misunderstandings around LF and CR/LF.
cheers!

Version 0.2
Remove fake .gz
Make executable
Click script.
ToDo_HTML_gui_gg-0.2.gz
Description  Remove fake .gz
Make executable
Click script.
gz

 Download 
Filename  ToDo_HTML_gui_gg-0.2.gz 
Filesize  3.61 KB 
Downloaded  50 Time(s) 
gui_2.jpg
 Description   
 Filesize   30.53 KB
 Viewed   106 Time(s)

gui_2.jpg

Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14474
Location: Gatineau (Qc), Canada

PostPosted: Wed 01 May 2019, 12:15    Post subject:  

Oh my God!

A dialog panel.
They're losing the subject of the thread!

Someone call the paramedics, quick!

Laughing

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5623
Location: Republic of Novo Zelande

PostPosted: Wed 01 May 2019, 15:37    Post subject:  

MochiMoppel wrote:
... RtfEdit, a lightweight editor that should do what you want. ... Text in each cell will be word wrapped within the cell without affecting other cell(s).
Thanks for the suggestion. I have trialled RTFed in the past but was concerned about its' level of readiness due to some program crashes ("invalid memory access") and the risk of incompatibility with other RTF capable word processors.

In your example above there is not actually a complete separation between the contents of each column - the text in one cell is vertically aligned to the centre of the text in the other cell. This is useable but it is irritating (especially when there is a large disparity between list length in column 1 versus column 2). However, in trying RTFed again I see that this problem can be eliminated by using the last icon in the table tools that you highlighted - that last icon allows the user to select text alignment in each cell, so if I set it to "Top" the lists start at the top of the cell which is helpful.

I used to be a big fan of RTF until i had major problems with incompatibilities between Abiword, Softmaker Office and other RTF readers struggling to read each others files. I feel inclined to avoid RTF mostly now.

RTFed seems to have similar compatibility issues.

If i create a file using RTFed it can be read by LibreOffice, but the reverse appears impossible. With LibreOffice being my current default RTF editor it means that any RTF ToDo file opens in LibreOffice, allowing editing, but thereafter I cannot edit the file in RTFed.

The rtf file created by RTFed can also be read (with mixed results) by Abiword - but again the format is not adequately common between the two WPs - therefore leads to formatting errors.

But then i thought why not use Abiword in it's ".abw" format??

That way I don't need to load some other bulky word processing suite, the file will never try to default to LibreOffice, and in any case Abiword is already on my system.

I hate to say it but this may be the simplest and most lightweight answer.

Abiword also gives me the best control over page orientation and margins. The output looks quite clean and tidy.

(but i do love the html utilities - they may come in handy for some other uses too....)
ABW.jpg
 Description   
 Filesize   33.95 KB
 Viewed   74 Time(s)

ABW.jpg

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 4 of 6 [84 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0804s ][ Queries: 13 (0.0210s) ][ GZIP on ]