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 26 May 2019, 23:24
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 3 of 6 [84 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Author Message
B.K. Johnson

Joined: 12 Oct 2009
Posts: 736

PostPosted: Mon 01 Apr 2019, 22:51    Post subject:  

greengeek wrote:
Quote:
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.
_________________
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

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


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

PostPosted: Thu 18 Apr 2019, 15:45    Post subject: Xournal possible solution  

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).
pdf_out.png
 Description   
 Filesize   67.11 KB
 Viewed   343 Time(s)

pdf_out.png

SampleJobsheet.pdf.gz
Description 
gz

 Download 
Filename  SampleJobsheet.pdf.gz 
Filesize  37.31 KB 
Downloaded  18 Time(s) 
SampleJobsheet.xoj.gz
Description 
gz

 Download 
Filename  SampleJobsheet.xoj.gz 
Filesize  1.77 KB 
Downloaded  38 Time(s) 
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Thu 18 Apr 2019, 16:47    Post subject:  

How about trying with two rows instead of two columns?
That just has to be feasible in a word processor.

_________________
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: 5511
Location: Republic of Novo Zelande

PostPosted: Sat 20 Apr 2019, 03:26    Post subject:  

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 Sad Wouldn't that be great?? Much more in the Puppy spirit rather than using 100MB of WP !!

Thanks for the help!
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Sat 20 Apr 2019, 05:59    Post subject:  

Hi, gg.

Is Geany good enough for you? Smile
Code:
#!/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!
Is-Geany-good-enough.jpg
 Description   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.
 Filesize   158.84 KB
 Viewed   296 Time(s)

Is-Geany-good-enough.jpg

2cols-todo-gg.sh.zip
Description  Same script as above, zipped.
zip

 Download 
Filename  2cols-todo-gg.sh.zip 
Filesize  768 Bytes 
Downloaded  19 Time(s) 
sortie.pdf.zip
Description 
zip

 Download 
Filename  sortie.pdf.zip 
Filesize  8.66 KB 
Downloaded  19 Time(s) 

_________________
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: 5511
Location: Republic of Novo Zelande

PostPosted: Sun 21 Apr 2019, 02:52    Post subject:  

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!
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Sun 21 Apr 2019, 03:27    Post subject:  

Glad you like it! Smile

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
~~~~~~~~~~
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: 3924
Location: holland

PostPosted: Mon 22 Apr 2019, 04:41    Post subject:  

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.php?p=1025971#1025971

Quote:
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:
<table class="table table-striped table-bordered">
  <col width="50%">
  <col width="50%">

Then column width is 50/50

Fred

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

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

PostPosted: Mon 22 Apr 2019, 07:29    Post subject:  

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
~~~~~~~~~~
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: 5511
Location: Republic of Novo Zelande

PostPosted: Thu 25 Apr 2019, 05:52    Post subject:  

fredx181 wrote:
but I think an improvement would be to add 2 lines to the exported styled html after <table class=... so becomes:
Code:
<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!
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 3924
Location: holland

PostPosted: Thu 25 Apr 2019, 06:33    Post subject:  

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:
<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

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


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

PostPosted: Fri 26 Apr 2019, 04:43    Post subject:  

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... Confused )

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.
css_style_output.jpg
 Description   
 Filesize   23.98 KB
 Viewed   156 Time(s)

css_style_output.jpg


Last edited by greengeek on Fri 26 Apr 2019, 05:56; edited 4 times in total
Back to top
View user's profile Send private message 
greengeek


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

PostPosted: Fri 26 Apr 2019, 05:32    Post subject:  

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:
# 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??
Halfstep_columns.jpg
 Description   
 Filesize   15.97 KB
 Viewed   138 Time(s)

Halfstep_columns.jpg

vertically_centralised_columns.jpg
 Description   
 Filesize   16.84 KB
 Viewed   138 Time(s)

vertically_centralised_columns.jpg

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


Joined: 11 Dec 2013
Posts: 3924
Location: holland

PostPosted: Fri 26 Apr 2019, 09:36    Post subject:  

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:
# 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

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


Joined: 11 Dec 2013
Posts: 3924
Location: holland

PostPosted: Fri 26 Apr 2019, 15:33    Post subject:  

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.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

Code:
#!/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:
#!/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
columns-html.png
 Description   
 Filesize   128.89 KB
 Viewed   95 Time(s)

columns-html.png


_________________
Dog Linux website
Tinylinux blog by wiak
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 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.0937s ][ Queries: 13 (0.0148s) ][ GZIP on ]