mdview, a markdown viewer

Miscellaneous tools
Message
Author
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

mdview, a markdown viewer

#41 Post by L18L »

Made in Fatdog64_701 where
xgettext msguniq msgunfmt msgmerge msgfmt
are included.

Code: Select all

#!/bin/sh

TITLE='translate .md files'

usage () { 
  die  "
  Create / edit translation file (GNU message catalog) from md files
  usage: $0 [file.md|directory]
 
    case file.md then each file under /etc /root /usr /var  will be processed 
    in case of directory then each file *.md in this directory will be processed   
        
   example 1: $0 README.md
   example 2: $0 /usr/share/doc/faqs/
   
   At least one file must contain %%textdomain <TEXTDOMAIN> 
   Translation is stored in $TEXTDOMAIN/${LANG%_*}/LC_MESSAGES/<TEXTDOMAIN>.mo
   Existing translations are always being re-used (msgmerge)
 "	
}

die () { [ $DISPLAY ] && Xdialog --title="$TITLE" --msgbox "$1" 0 0 || echo $1; exit 1; }

[ `whoami` = root ] || die "This tool is for root only."

create_pot () {
  # create ${WD}/${aTEXTDOMAIN}.pot file from .md file(s) using xgettext and mdview --po
  aTEXTDOMAIN=$1
  FILES=$2
  local MD=MD$$
  
  echo " " | xgettext -o ${WD}/${aTEXTDOMAIN}_.pot -L shell --package-name=$aTEXTDOMAIN --from-code=UTF-8 --force-po -
  sed -i 's/charset=CHARSET/charset=UTF-8/' ${WD}/${aTEXTDOMAIN}_.pot
  echo "" >> ${WD}/${aTEXTDOMAIN}_.pot

  for aFILE in $FILES; do
    grep -v '$(g' ${aFILE} > $MD
    mdview --po        ""   $MD >> ${WD}/${aTEXTDOMAIN}_.pot
    xgettext -L shell $aFILE -j -o ${WD}/${aTEXTDOMAIN}_.pot
  done

  msguniq -u --to-code=UTF-8 -o ${WD}/${aTEXTDOMAIN}.pot ${WD}/${aTEXTDOMAIN}_.pot 
  rm ${WD}/${aTEXTDOMAIN}_.pot
  rm $MD
}

create_po () {
  aTEXTDOMAIN=$1
  if [ -f "${TRANSLATED}" ]; then
    msgunfmt ${TRANSLATED} -o - > ${WD}/${aTEXTDOMAIN}_OLD.po
  else
    urxvt -e msginit --no-translator --no-wrap --locale=${transLANG} --input=${WD}/${aTEXTDOMAIN}.pot --output-file=${WD}/${aTEXTDOMAIN}_OLD.po
  fi 
}


translate_until_error_free  () {
  ATEXTDOMAIN=$1
  #code from momanager by Barry Kauler	
  #130502 L18L/BK: stay in a loop if there is an error converting .po to .mo...
  ABORTFLG=0
  cp -f $WD/${ATEXTDOMAIN}.po $WD/${ATEXTDOMAIN}.poBACKUP1
  while true ; do
    killall geany 2> /dev/null #otherwise geany will return immediately and continue executing this script.
    sleep 0.5

    geany $WD/${ATEXTDOMAIN}.po

    if [ ! diff -q $WD/${ATEXTDOMAIN}.poBACKUP1 $WD/${ATEXTDOMAIN}.po  >/dev/null 2>&1 ] ; then
      ABORTFLG=8
      break
    fi
    msgfmt --output-file=- $WD/${ATEXTDOMAIN}.po >/dev/null 2> $WD/po-2-mo.err
    [ ! -s $WD/po-2-mo.err ] && break

    pupdialog --background '#FF8080' --backtitle "${0##/*}: po to mo fail" --extra-button --yes-label "Fix" --no-label "Abort" --extra-label "Revert" --yesno "There are errors in the .po file:

`cat $WD/po-2-mo.err`

NOTE: The above error message is logged to $WD/po-2-mo.err

Click the 'Fix' button to edit the .po file again...
Click 'Revert' to go back to original .po file, and try again...
Click 'Abort' to give up..." 0 0
    case $? in
      0)  continue  ;; #Fix
      3)  cp -f $WD/${ATEXTDOMAIN}.poBACKUP1 $WD/${ATEXTDOMAIN}.po ; continue ;; #Revert
      *)  ABORTFLG=9 ; break ;; #1=Abort
    esac
  done
  
  if [ $ABORTFLG -eq 0 ];then
    rxvt -e msgfmt --check --output-file=$WD/${ATEXTDOMAIN}.mo $WD/${ATEXTDOMAIN}.po
    pupdialog --background yellow --colors --backtitle "${0##/*}: post-edit mo" --yes-label "OK" --no-label "Cancel" --yesno "The file $WD/${ATEXTDOMAIN}.po has been edited and converted to $WD/${ATEXTDOMAIN}.mo. If all went well, click the \ZbOK\ZB button to copy it to \Zb${TRANSLATED}\ZB. Note, as a precaution, the old mo file is at $WD/${ATEXTDOMAIN}.moOLD." 0 0
    ABORTFLG=$?
  fi

  if [ $ABORTFLG -eq 0 ];then
    cp -f $WD/${ATEXTDOMAIN}.mo "${TRANSLATED}"
  else
    pupdialog --background pink --backtitle "${0##/*}: mo edit aborted" --msgbox "You have declined to update the mo file. Ok, the previous one has been retained." 0 0
  fi
} 

##############################

case $1 in -*) usage ;; esac

read transLANG < $FATDOG_STATE_DIR/language #ex:de_BE.UTF-8
[ "$transLANG" ] || transLANG=$LANG
[ "$transLANG" ] || die "Sorry, need language LANG."
transLANG=${transLANG%_*} #ex:de

WD=/tmp/md; mkdir -p $WD

[ "$1" ] && FROM=`realpath "$1" 2>/dev/null`

[ $FROM ] || FROM=$(Xdialog --title "$TITLE to $transLANG" --backtitle="Choose .md file \n(or cancel to select a directory)" --no-buttons --fselect $HOME 0 0 2>&1)
[ "${FROM##*.}" = "md" ] || [ -d $FROM ] || die "no .md file selected"

[ $FROM ] || FROM=$(eval Xdialog --title \"$TITLE to $transLANG\" --backtitle=\"All .md files in directory:\" --no-buttons --dselect /usr/share/doc/faqs/ 0 0 2>&1)
[ ${FROM##*.} = md ] || [ -d $FROM ] || die "no .md file found in $FROM"

if [ -d $FROM ]; then
  FILES="`ls ${FROM}/*.md`"
else
  FILES="`find /etc /root /usr /var -maxdepth 3 -wholename ${FROM}`"
fi
aTEXTDOMAIN="`grep -m1 %%textdomain $FILES | cut -d' ' -f2  | uniq `"
[ "$aTEXTDOMAIN" ] || die "no %%textdomain found"

TRANSLATED=${TEXTDOMAINDIR}/${transLANG}/LC_MESSAGES/${aTEXTDOMAIN}.mo

create_pot $aTEXTDOMAIN "$FILES"
create_po $aTEXTDOMAIN
msgmerge ${WD}/${aTEXTDOMAIN}_OLD.po ${WD}/${aTEXTDOMAIN}.pot -o - > $WD/${aTEXTDOMAIN}.po

# remove comment sign, ex: change #~ msgid "bla" to msgid "bla"
sed -i 's/^#~ //' $WD/${aTEXTDOMAIN}.po #that is: keep unused translations !
sync
translate_until_error_free $aTEXTDOMAIN

exit 0
Used to translate mdview's examples/.
(small changes in index.md [attached])
25 messages....
Attachments
mdview_examples_translated.png
(63.34 KiB) Downloaded 464 times
domain.mo.gz
remove fake .gz
save as /usr/share/locale/de/LC_MESSAGES/domain.mo
(3.33 KiB) Downloaded 358 times
index.md.gz
remove fake .gz
(1.28 KiB) Downloaded 363 times

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#42 Post by step »

@jamesbond, is there a way to start mdview with X11 geometry arguments like WxH+X+Y, or any way to start it in a given screen position with given window dimensions?
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

howto translate .md docs

#43 Post by L18L »

Recent momanager can.

mdview --po is automatically used with .md files that have a %%textdomain.

Note, you must have installed latest mdview, see 1st post of this thread, download,

Code: Select all

make
and copy executable mdview to /usr/bin.

Example file :

Code: Select all

%%textdomain mdview

This document contains list of all supported features.

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

%%nopot yes
**%%textdomain** domain

%%nopot no

The above line should be invisible, it sets the translation domain 
for use with this document (no-standard).

# Heading 1

This is also heading 1
===

## Heading 2

This is also heading 2
---

### Heading 3

This is a ruler

---

This one too

***

Bullets (only unordered supported for now)

%%nopot yes

 * a
 * b
 * c
 
%%nopot no

Codeblocks (4 spaces or tabs preceded everyline):
	function a()
	  b="*c*"
	}

### Inline styles

*italic1*, _italic2_, **bold1**, __bold2__, `inline code`, and `inline code again`, then 
**_bold-italic1_**, __*bold-italic2*__, and
"Smart double-quoting", 'smart single-quoting', em-dash: -- .

We also have non-standard ---strikethrough---.

Links:
* [Link to another file](file.md)
* [HTTP link to google](http://www.google.com) "Google Search"
* [HTTPS link to google](https://www.google.com)
* This is not a link: http://www.google.com 
* This is not a link: https://www.google.com

Inline image support: ![Tux](linux3.png)

(image path is always relative to document directory)

If you use the -x option, executable code is supported: $(echo '$LANG') is $(echo $LANG).
[Quoting-test for exec mode](quote-test.md).

**The End**

---

## Appendix: About translations

Default is create translation for **entire line** which can be a very long line (a paragraph <p> in terms of markup).

### No ---Translation---

A line starting with **tab** or **4 spaces** is NOT translated.

If you have a line which must **not** be translated (always code, maybe a name, parameter, etc) mark the line by %%nopot tags (nopot yes and nopot no) :

%%nopot yes

**%%nopot** yes

Let these English lines stay English only.

Nothing inside these tags will go into translation file.

**%%nopot** no

%%nopot no
Save it to e.g. /root/examples/mdview.md
and new momanager will present it for translation.

Feedback welcome.

EDIT: Here i s how it looks (untranslated)
Attachments
mdview.png
(30.91 KiB) Downloaded 444 times

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

mdview, a markdown viewer

#44 Post by L18L »

bump
not just because I am always unseccessfully searching this in "Documents"...

mdview uses internal gettext i.e. entire line is a translatable message.

This is not really new,
But really new is:

You can use one textdomain for scripts and .md file.
This should be conveniant for help and/or README files.

ex: the app has textdomain apple.
define

Code: Select all

export TEXTDOMAIN=apple 
in the scripts
and define

Code: Select all

%%textdomain apple
in their .md files.
Next version of momanager can handle this so that translators see and translate just one file apple.po.

( Next version of momanager can handle also technosaurus' method additionally so that translators see and translate just one translation file.)

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#45 Post by step »

I tried to make me like this type of convenience several times, but I couldn't convince myself for the following reasons:
1. mdview is not a puppy standard, it's a Fatdog add-on.
2. mdview markdown support has some limits
3. What are the advantages of creating HTML documentation and giving that out to translate vs giving the md file out to translate? I still need to figure that out.
If the perceived benefits aren't readily apparent, gettexting md files is a hard sell, IMO.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#46 Post by L18L »

step wrote:I tried to make me like this type of convenience several times, but I couldn't convince myself for the following reasons:
1. mdview is not a puppy standard, it's a Fatdog add-on.
You forgot to say: It is new!
[EDIT]And you forgot to say: it is not an Ubuntu standard...[/EDIT]
step wrote:2. mdview markdown support has some limits
Everything has some limits.
step wrote:3. What are the advantages of creating HTML documentation and giving that out to translate vs giving the md file out to translate? I still need to figure that out.
Give out is publish?
Both of these are not good in my opinion as translators have to know some rules of html or mdview's markdown.
Translators are used to translate msgid to msgstr.
step wrote:If the perceived benefits aren't readily apparent, gettexting md files is a hard sell, IMO.
There isn't anything to sell.

It is all free.

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

bug report

#47 Post by step »

@jamesbond, I think I found a bug. Attached an md file to reproduce the issue. Essentially, when a line starts with [2] and includes matching brackets the text between [2] and the brackets included disappears. Version 2016.02.04 built on Thu Feb 4 07:09:52 2016.
Attachments
mdview-bug-report-1.md.fake.gz
(1.57 KiB) Downloaded 306 times
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

fenced blocks and gettext

#48 Post by step »

@jamesbond, there's another issue concerning fenced code blocks and translations. I just realized that mdview --po doesn't output the text inside fenced blocks. On one hand that makes sense - it's source code after all - on the other hand it is a problem, because that text becomes invisible to the translation process, so it's hard to realize that it even exists before deciding if it should be translated or not.

There are valid cases for using fenced blocks for text other than source code, which should therefore be translated. So I'm proposing a work-around which I think doesn't break the fenced block syntax.

Code: Select all

```
this text is pre-formatted and hidden to gettext
```
vs.

Code: Select all

```gettext
this text is pre-formatted and it's also gettexted
```
This should work, since GFM fenced blocks can take an optional language tag to select appropriate syntax highlightling rules. GFM seems to ignore unknown tags, so here 'gettext' is passed as a language tag but mdview interprets it as an operational directive. What do you think?

----
Reproduce issue by

Code: Select all

# cat >> /tmp/zz.md
HAL's typewriter ticked a message:
```
I can't let you do that, David, I can't let you turn me off.
```
David was afraid.

# mdview --po /tmp/zz.md
#: //tmp/zz.md:1
msgid "HAL's typewriter ticked a message:"
msgstr ""

#: /tmp/zz.md:5
msgid "David was afraid. "
msgstr ""
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

update on bug reported two posts above

#49 Post by step »

@jamesbond, here's another test case for the bug reported two posts above

Code: Select all

 * Run mdview[3] to test your translation of markdown files (see below)
This is rendered as "* Run mdview3" and nothing else.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

proposed patch Re: fenced blocks and gettext

#50 Post by step »

@jamesbond
step wrote:...I'm proposing a work-around which I think doesn't break the fenced block syntax.

Code: Select all

```gettext
this text is pre-formatted and it's also ouput with mdview --po
```
I'm attaching a patch file, which implements the above work-around, for you and anyone else interested to review. Patch file against fossil 4fb552f2b09ca5ec 2016-02-04 07:11:16.

I still haven't started debugging the other issue I reported.

edit 20160223 I'm attaching a second patch file, which contains the first one. This file adds tests for the proposed patch and turns off translation of GitHub codeblocks unless they are marked "```gettext```". I'm not sure if you left translations enabled for GH codeblocks intentionally, but I think that disabling translations is consistent with all other types of codeblocks. Once again, "```gettext```" has a dual purpose, 1) enable outputting codeblock text with option --po, and 2) translating such text in normal operation.
Attachments
codeblock-gettext-2.patch.gz
Delete fake .gz extension
(6.66 KiB) Downloaded 272 times
codeblock-gettext.patch.gz
Delete fake .gz extension
(4.19 KiB) Downloaded 276 times
Last edited by step on Tue 23 Feb 2016, 17:09, edited 1 time in total.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: bug report

#51 Post by L18L »

step wrote:@jamesbond, I think I found a bug. Attached an md file to reproduce the issue. Essentially, when a line starts with [2] and includes matching brackets the text between [2] and the brackets included disappears. Version 2016.02.04 built on Thu Feb 4 07:09:52 2016.


I don't know any thing about triple backticks
What I do know is: Brackets are used with external links.
[mdview](http://chiselapp.com/user/jamesbond/rep ... iew3/index)

Tried to solve your problem, see screenshot.
Attachments
use_escape_with_markdown.png
Note escapes
(25.48 KiB) Downloaded 377 times

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

Re: bug report

#52 Post by step »

Hi L18L, thanks for your help. Your work-around shows that mdview can create correct output when "\[2\]" replaces "[2]" in the example above. This is useful, but backslashes shouldn't be needed in a common markdown implementation, so I think mdview still needs to be fixed about this problem.

As far as I know, in markdown brackets immediately followed by parens (round brackets) introduce a link label and its link target, like so:
[label](target)
where the target can be a local file or a URL.

This bug concerns the case where there is extra text between the closing square bracket and the opening round bracket, like so:
[2] some (text)

It should not produce a link with 2 as the label and "some (text)" as the target. It should produce just the text "[2] some (text)".

wikipedia states that a markdown standard doesn't exist. However, most common markdown implementations render "[2] some (text)" as text and not as a link, unlike mdview.

You can test several markdown engines at once by visiting this link: http://johnmacfarlane.net/babelmark2/?t ... 5D(target)

(apparently if I wrap the above URL inside url bbcode this post renders as an empty box)
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: bug report and "translated pre-formated" text

#53 Post by L18L »

step wrote:wikipedia states that a markdown standard doesn't exist. However, most common markdown implementations render "[2] some (text)" as text and not as a link, unlike mdview.

You can test several markdown engines at once by visiting this link: http://johnmacfarlane.net/babelmark2/?t ... 5D(target)
Thanks for this interesting link.

However, I am not interested in markdown engines other than mdview.
It is clearly stated to support a subset of markdown.
This subset has been working good enough for Fatdog's Help which does not use reference-style links
... and not need translated pre-formated text.

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

Re: bug report and "translated pre-formated" text

#54 Post by step »

L18L wrote: This subset has been working good enough for Fatdog's Help which does not use reference-style links
... and not need translated pre-formated text.
Findnrun needs the latter. That's why I'm proposing patches. I'm careful not to break existing code, and it's all intentional anyway, since Jamesbond will review my patches and decide whether they can go in or not.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

text links proposed patch

#55 Post by step »

@jamesbond, for your consideration, here is a proposed patch for the text links issue I reported earlier. It affects function egg_markdown_to_text_line_formatter_links. Note: I didn't patch image links, function egg_markdown_to_text_line_formatter_image, in a similar fashion, because in practical use I don't expect this issue to occur for image links.

The patch file is made against the source code already patched for code blocks. A markdown test file is attached.

I should make clear that this patch doesn't concern so-called reference-style links, which I don't think mdview supports. It's a patch for regular text links.
Attachments
text-links-patch.md.fake.gz
remove .fake.gz extension
(1.77 KiB) Downloaded 268 times
text-links.patch.fake.gz
remove .fake.gz extension
(2.36 KiB) Downloaded 287 times
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#56 Post by jamesbond »

step, all patches applied (both codeblock-gettext and text-links patch): https://chiselapp.com/user/jamesbond/re ... 3/timeline

Thank you.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#57 Post by 01micko »

In the very latest build (recently pushed to petbuilds) everything seems to be working fine - but I have a feature request.

The files from puppylinux.com (which are in markdown format - converted to html server side) open fine on my local machine - but if there is a wide image it can't be viewed (re the timeline). I wonder if it is feasible to add a horizontal scrollbar? Mind you, this is probably beyond the scope of the project so I understand if you'd rather keep it simple. :)
Puppy Linux Blog - contact me for access

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#58 Post by jamesbond »

01micko wrote:I wonder if it is feasible to add a horizontal scrollbar?
Turns out it's a one line change:

Code: Select all

--- help-viewer.c
+++ help-viewer.c
@@ -599,11 +599,11 @@
 #endif	/* GTK_CHECK_VERSION(2,16,0) */
 	
     scrolledhelp_viewer = gtk_scrolled_window_new (NULL, NULL);
     gtk_widget_show (scrolledhelp_viewer);
     gtk_box_pack_start (GTK_BOX (vbox), scrolledhelp_viewer, TRUE, TRUE, 0);
-    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledhelp_viewer), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledhelp_viewer), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 
     markdown_textview = markdown_textview_new();
     markdown_textview_set_image_directory(MARKDOWN_TEXTVIEW(markdown_textview), help_dir);
     markdown_textview_set_exec(MARKDOWN_TEXTVIEW(markdown_textview),enable_exec);
     markdown_textview_set_use_gettext(MARKDOWN_TEXTVIEW(markdown_textview),use_gettext);
I will update this in fossil too.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#59 Post by 01micko »

jamesbond wrote:
01micko wrote:I wonder if it is feasible to add a horizontal scrollbar?
Turns out it's a one line change:

Code: Select all

--- help-viewer.c
+++ help-viewer.c
@@ -599,11 +599,11 @@
 #endif	/* GTK_CHECK_VERSION(2,16,0) */
 	
     scrolledhelp_viewer = gtk_scrolled_window_new (NULL, NULL);
     gtk_widget_show (scrolledhelp_viewer);
     gtk_box_pack_start (GTK_BOX (vbox), scrolledhelp_viewer, TRUE, TRUE, 0);
-    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledhelp_viewer), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledhelp_viewer), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 
     markdown_textview = markdown_textview_new();
     markdown_textview_set_image_directory(MARKDOWN_TEXTVIEW(markdown_textview), help_dir);
     markdown_textview_set_exec(MARKDOWN_TEXTVIEW(markdown_textview),enable_exec);
     markdown_textview_set_use_gettext(MARKDOWN_TEXTVIEW(markdown_textview),use_gettext);
I will update this in fossil too.
Image
Attachments
mdview.jpg
(38.35 KiB) Downloaded 281 times
Puppy Linux Blog - contact me for access

Sailor Enceladus
Posts: 1543
Joined: Mon 22 Feb 2016, 19:43

#60 Post by Sailor Enceladus »

For some reason, mdview doesn't seem to show this md file at all. Viewing it in Leafpad or in that link (with Firefox) works ok.

Post Reply