Two columns in leafpad or geany ??

Using applications, configuring, problems
Message
Author
B.K. Johnson
Posts: 807
Joined: Mon 12 Oct 2009, 17:11

#31 Post by B.K. Johnson »

greengeek wrote:
Thanks B.K - what would the output look like once printed? Wouldn't it just be a single document in portrait mode? The ability to edit different parts of the document is good - but i also need to see the two different lists displayed visually next to each other once printed as landscape.
You're right. Printing isn't possible. Scratch the suggestion.
[color=blue]B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

Xournal possible solution

#32 Post by greengeek »

Just to clarify why a word processor seems unsuitable for this application -

I do not know how to place two entirely separate tables next to each other on a landscape page.

I can make a table with two columns, but the columns are "linked" - in the sense that if i add a 3 line item to a row in the left hand column, it automatically expands the corresponding row in column 2. This means that the list in column 1 cannot be maintained independently of the list in column 2.

If it were possible in a word processor to place two tables next to each other I could use this for my job sheet. (Probably this can be done by making a table as some sort of "object" insertion - with special alignment specified somehow. I just don't know how to do it).

However, I have found a way to achieve something similar to what I need:
Xournal is a surprisingly powerful pdf editor and basic drawing utility and it allows me to create a Landscape A4 page, draw a vertical line seperating my lists and then use the text tool to build (and edit) my two lists independently.

Here is a screenshot and an actual sample .xoj "xournal project" file along with an exported pdf

(Remove the fake .gz suffixes to view the files).
Attachments
pdf_out.png
(67.11 KiB) Downloaded 378 times
SampleJobsheet.pdf.gz
(37.31 KiB) Downloaded 94 times
SampleJobsheet.xoj.gz
(1.77 KiB) Downloaded 118 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#33 Post by musher0 »

How about trying with two rows instead of two columns?
That just has to be feasible in a word processor.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#34 Post by greengeek »

musher0 wrote:How about trying with two rows instead of two columns?
That just has to be feasible in a word processor.
Well, you've prompted me to have another crack with a WP and it seems that having ONE row may be the answer. That way the bigger column (either Work or Personal) grows as the items increase, and the other column can be as full or empty as required. The two columns don't try to keep step the way they did originally where I had one row for each new item.

If I limit the table to one row I can just copy from leafpad and paste my WORK list to column one and my PERSONAL list into column two and it seems to work well.

Except for the fact I can't seem to print Landscape from Apache Openoffice (unless I export it to pdf first...) - but that's a problem for another day.

Still wish I could have a dual pane leafpad :( Wouldn't that be great?? Much more in the Puppy spirit rather than using 100MB of WP !!

Thanks for the help!

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#35 Post by musher0 »

Hi, gg.

Is Geany good enough for you? :)

Code: Select all

#!/bin/bash
# /usr/local/bin/2cols-todo-gg.sh
# For greengeek (PuppyLinux forum)
# http://murga-linux.com/puppy/viewtopic.php?t=115747&start=30
# (c) musher0, April 20th 2019. GPL3.
####

DATE="`date '+%y-%m-%d'`"
TODO="/root/my-documents/2cols-todo-gg.$DATE"
# We specify the date as the file ending, to keep these
# files sorted in chronological order in ~/my-documents

if [ ! -f $TODO ];then # If file exists, we do not redo it.
	date '+%c' > $TODO # We include today's date.

# We create the frame.
	echo "
WORK                                | PERSONAL
____________________________________|________________________________" >> $TODO
	j="1"
	for i in `seq 9`;do
		SprtR=" $j -                                | $j -"
		echo "$SprtR" >> $TODO
		j="`expr $j + 1 `"
	done
	echo -e "\e[1A"
	echo "_____________________________________________________________________
NOTES
" >> $TODO
fi
# We open the file in a new instance of Geany to NOT interfere
# with other editing work that you may be working on.
geany -i $TODO 
zip -9 -q $TODO.zip $TODO # We make a quiet back-up.
# end #
The only thing is:
Remember to type your text in the WORK column with Insert OFF. Other-
wise, the separator won't stay put. I think that would be a minor incon-
venience, since the other solutions you tried seemed unsatisfactory.

Typing in the PERSONAL column, however, insert or squish text as you
like, it will not matter.

I took the liberty of adding a NOTES section, for those things that fall
neither in the WORK nor in the PERSONAL categories.

-- I did some tests in nano, but it uses the Insert key for something else.

-- I tried it in joe, but joe does not squish characters as you type. Period.

-- Leafpad does not have very good rendition for underscores.

So I was left with Geany. It looks good, it can squish or insert characters,
plus, answering a previous question of yours, Geany does print to pdf
sideways (wide-style).

Just make sure to tick off all the settings in the right-most tab in the
printing panel. Please see the attached "Sortie.pdf" for an example.

So what you do is: whenever you need to, you fire up this script.
Very simple.

Finally, the script has two safeguards:
1) it will not redo a blank frame if today's TODO file exists: it will load the
existing one in Geany. So your previous entries for the day are safe.

2) it quietly makes or updates a zipped back-up every time you QUIT
your Geany TODO instance. Note: that's "quit the app", not just "close
the text".

That's in addition to the automatic time-save function you may already
have activated and configured in Geany.

I have commented the script. If you have other questions, please ask.

Enjoy!
Attachments
Is-Geany-good-enough.jpg
Sorry for the date in French. That line is created by the < date '+%c' >
command, so it will print in the locale you have defined for your computer.
(158.84 KiB) Downloaded 332 times
2cols-todo-gg.sh.zip
Same script as above, zipped.
(768 Bytes) Downloaded 91 times
sortie.pdf.zip
(8.66 KiB) Downloaded 95 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#36 Post by greengeek »

musher0 wrote:Remember to type your text in the WORK column with Insert OFF. Other-wise, the separator won't stay put. I think that would be a minor incon-venience, since the other solutions you tried seemed unsatisfactory.

Typing in the PERSONAL column, however, insert or squish text as you like, it will not matter.
!
Merci bien musher0! Mais je ne comprend pas " type your text in the WORK column with Insert OFF." Explique si'l vous plait?

I don't know how to turn off insert. is that a function within geany? Or a keyboard setting?

If I type data iin the work column the separator moves right also - so I am assuming i am breaking the cardinal rule.

Otherwise - looks very promising.

cheers!

EDIT: Ahhh, i see - my keyboard has an "INS" key that switches between "overtype" and "insert". Who even knew that existed or what the heck it was for? Not me!

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#37 Post by musher0 »

Glad you like it! :)

TWYL

~~~~~~~~~~~
PS, a couple of hours later.
I discovered that overtype CAN be used in the joe editor.
The switch is < Ctrl-T T >.
This opens up a choice of editors, doesn't it.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#38 Post by fredx181 »

Hi greengeek, just in case you are interested in markdown > html, see here for doing a similar thing as you're looking for (with style block added to html makes the columns full width) And not depending on online service.
http://murga-linux.com/puppy/viewtopic. ... 71#1025971
What would be great is if Dillinger had the ability to format the lists as a very basic two column display without the excessive whitespace.
Dillinger doesn't, but I think an improvement would be to add 2 lines to the exported styled html after <table class=... so becomes:

Code: Select all

<table class="table table-striped table-bordered">
  <col width="50%">
  <col width="50%">
Then column width is 50/50

Fred

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#39 Post by musher0 »

Hello greengeek and all.

I made a pet of it and stored it here.

It's a version 2, bilingual (EN-FR), to which I have added:

-- a companion script to change from the geany editor to the joe editor
and vice versa. Requires replaceit, but all recent Puppies have it now;

-- loading of yesterday's TO-DO in addition to the one for the current day.
If you have not finished a task yesterday, with such a lay-out you can
easily copy and paste that task from yesterday to today.

-- geany presents the two TO-DOS as tabs, like it always does for multiple
texts, whereas joe presents them top-bottom. Some people might prefer
the latter lay-out (I know I do). The other thread has captures of the use
with the joe editor.

-- the pet comes with a desktop file and its icon, so it will show in the
menu under "Personal". As well, you may wish to drag that desktop file
on the desktop for faster access.

-- a wrapper to launch the joe editor as a quasi-GUI window is included. In
this context, I do not recommend launching it as a traditional terminal app.

-- I kept all the other features, back-up, etc., from the initial version.

That's about it. Any questions, please ask.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#40 Post by greengeek »

fredx181 wrote:but I think an improvement would be to add 2 lines to the exported styled html after <table class=... so becomes:

Code: Select all

<table class="table table-striped table-bordered">
  <col width="50%">
  <col width="50%">
Then column width is 50/50
Where would i be putting this code please? I can't see an existing "<table class" definition anywhere.
cheers!

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#41 Post by fredx181 »

greengeek wrote:
fredx181 wrote:but I think an improvement would be to add 2 lines to the exported styled html after <table class=... so becomes:

Code: Select all

<table class="table table-striped table-bordered">
  <col width="50%">
  <col width="50%">
Then column width is 50/50
Where would i be putting this code please? I can't see an existing "<table class" definition anywhere.
cheers!
If you export to html from Dillinger and the markdown input is a table, then "<table class" should be there in the html output.

Fred

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#42 Post by greengeek »

Thanks Fred, it's finally getting into my head now. Interesting approach.

I tried using a split of 60% column width for "Work" and 40% for "Personal" and I am happy with that.

The issue I would like to get rid of is that the table structure allocates a single row for each item in the in,md file and this results in rows getting "vertically whitespaced" when the same row in the other corresponding column is wrapping several lines.

I think this is going to work best for me if i have only ONE data row - and accumulate my list items in that one row. This way i can have many items in col1 row1 and it will not affect col2 row1 wrapping (hope that makes sense... :? )

Do I somehow need to change the css style for the table, or do i simply restructure the in.md file wthout the pipe characters delimiting each line?

cheers!

EDIT It appears that in order to ensure that only one row exists - i need to have all "work" entries on one single line, then one pipe character, then all of the personal items on one single line.
This is somewhat tricky to type and irritating to read so I tried to use the enter key to make it more readable but that added line feeds that seemed to stuff up the markdown conversion. I need to find a way to format the list in a way that the necessary line breaks are respected correctly when assembled into the html table.
Attachments
css_style_output.jpg
(23.98 KiB) Downloaded 191 times
Last edited by greengeek on Fri 26 Apr 2019, 09:56, edited 4 times in total.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#43 Post by greengeek »

Hi Fred - i am just experimenting with formatting (thinking about how i might build a useable table from my work/personal lists) - and I wondered if you would have time to view the output of the following in.md file:

Code: Select all

# Header....

| Work     |  Personal           |
| :----------------|  :--------------- |
|1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10|A<br>B<br>C<br>D<br>E<br>F<br>G<br>
I was surprised at the different vertical positioning of the rows in the two columns. I expected col 1 and col 2 to align at row 1.

The rows are not even aligned on line boundaries ("half-stepped" instead)

Any thoughts??
Attachments
Halfstep_columns.jpg
(15.97 KiB) Downloaded 173 times
vertically_centralised_columns.jpg
(16.84 KiB) Downloaded 173 times

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#44 Post by fredx181 »

greengeek wrote:Hi Fred - i am just experimenting with formatting (thinking about how i might build a useable table from my work/personal lists) - and I wondered if you would have time to view the output of the following in.md file:

Code: Select all

# Header....

| Work     |  Personal           |
| :----------------|  :--------------- |
|1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10|A<br>B<br>C<br>D<br>E<br>F<br>G<br>
I was surprised at the different vertical positioning of the rows in the two columns. I expected col 1 and col 2 to align at row 1.

The rows are not even aligned on line boundaries ("half-stepped" instead)

Any thoughts??
Hi greengeek, I tried that and my guess is (but I don't know much about markdown how exactly it works) that it may look like mutiple rows but in fact it's only one and markdown conversion to html just makes the text in the right hand column center vertically. (you get better view of that when exporting as styled html from Dillinger)
Nice, btw, that is possible to mix it with html code, I'v seen that before, but not the way you did.
Markdown has it's limitations, but maybe with some more experimenting you can make it work as desired.

Fred

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#45 Post by fredx181 »

Hi greengeek, 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. ... 03#1023403
At top of script you can change the text to display for left and right column.
Running it will create out.html

Code: Select all

#!/bin/bash

# textarea for left column, edit as you wish
COLUMN1='
1) Long text: All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically.
2) Second line: Short text
3) Long text again: All on one line, wraps automatically. All on one line, wraps automatically All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically
4) Next line has no text:
5)
6) Hello World
'

# textarea for right column, edit as you wish
COLUMN2='
1) First line: Short text
2) Long text: All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically.
3) Third line: Short text
4) Next line has no text:
5) 
6) Long text again: All on one line, wraps automatically. All on one line, wraps automatically All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically
7) Hello World
'

# 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: 6px auto;
  table-layout: fixed;
}

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

th,
td {
  padding: 4px;
  border: solid 1px #D2D5D8;
  text-align: center;
}
</style>
<body>
   
<table>
<tbody><tr>
    <th>Work</th>
    <th>Personal</th>
</tr>
<tr>
    <td><textarea cols="80" rows="50">
'"$COLUMN1"'

</textarea></td>
    <td><textarea cols="80" rows="50">
'"$COLUMN2"'

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

</body></html>
' > out.html
EDIT: This one has some changes in the style, looks a bit better IMO.

Code: Select all

#!/bin/bash

# textarea for left column, edit as you wish
COLUMN1='
1) Long text: All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically.
2) Second line: Short text
3) Long text again: All on one line, wraps automatically. All on one line, wraps automatically All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically
4) Next line has no text:
5)
6) Hello World
'

# textarea for right column, edit as you wish
COLUMN2='
1) First line: Short text
2) Long text: All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically.
3) Third line: Short text
4) Next line has no text:
5)
6) Long text again: All on one line, wraps automatically. All on one line, wraps automatically All on one line, wraps automatically. All on one line, wraps automatically. All on one line, wraps automatically
7) Hello World
'

# 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 {
font-family: Sans, sans-serif;
   width: 100%;
padding-left: 5px;
 padding-right: 5px; 
box-sizing: border-box;

}
table {
  width: 100%;
  table-layout: fixed;
}

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

th,
td {
  border: solid 1px #D2D5D8;
  text-align: center;
}
</style>
<body>
   
<table>
<tbody><tr>
    <th>Work</th>
    <th>Personal</th>
</tr>
<tr>
    <td><textarea cols="80" rows="50">
'"$COLUMN1"'

</textarea></td>
    <td><textarea cols="80" rows="50">
'"$COLUMN2"'

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

</body></html>
' > out.html
Fred
Attachments
columns-html.png
(128.89 KiB) Downloaded 131 times

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#46 Post by wiak »

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/viewto ... 61#1026561

wiak

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#47 Post by musher0 »

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/viewto ... &id=122995
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#48 Post by greengeek »

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!

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#49 Post by greengeek »

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. ... 03#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: Select all

# 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
Attachments
Fred6502Mod.jpg
(30.42 KiB) Downloaded 273 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#50 Post by musher0 »

Hi greengeek.

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

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply