[Zim-wiki] Export in one click

2016-05-04 Thread Charles Nepote

Hi all,


I wrote a little bash script as a "Custom tool" to export a page in one
click (see code attached).

To wrote this script, I was facing the problem that calls to Custom
tools does not provide a "pagename" parameter (Page:SubPage:SubPage) to
supply the --export parameter. I had to extract this information with
regexps.

It would be nice:
* to provide a %p parameter for the name of the page
* or let --export function to accept %s as the [PAGE] to be exported

Am I clear enough? Did I miss something?
My next step is to provide the ability to rsync the result in one click.

My goal is to manually export and publish some static pages on the web. 
The current ability to --export a whole notebook is not good for me as I 
want to publish only some pages and not all ones.



Thanks for zim.


Charles Nepote.



export.sh
Description: application/shellscript
___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


[Zim-wiki] Organizing feature requests?

2016-05-04 Thread Agustin Lobo
Would it be possible having a page for feature requests
in which users could vote and add funding?
I think on a list with columns
feature name, feature description, votes for, votes against, funding,
complexity, priority likelihood

where the 3 last ones would be set by the developper considering
votes, funding and his will. I think that priority should give complexity
a lot of weight: for example, leting zim open files with extensions other
than *.txt would perhaps not be interesting for many, but it would be
so simple to implement...
As "feature description" should be very short, the proposer could just
write a simple page (using zim, of course) being linked
from "feature name".

Also, there should be some way of checking the likelihood of a given
feature to become real before actually adding funding. For example, I would
invest on a better and smoother MacOSX installation, but as I know
this is not going to happen I rather put my money elsewhere. Perhaps
discussing on the mailing list is the only way.

Cheers,

Agus
-- 
Agustin Lobo
aloboa...@gmail.com

___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] Request for Plugin

2016-05-04 Thread Pl

Hi Bo,
 Until someone writes a decent plugin to solve this properly, I've made 
a rather simple implementation which I hope can at least partially save 
your neck in the meantime :). It automatically scrolls the text to the 
center of the window after pressing some keys like Up, Down, Enter etc. 
If the text is near the beginning/end scrolling is disabled, to avoid 
this you can temporarily put there some text or newlines.
 To install it put the file to the plugins' directory and enable it in 
preferences. You can enable/disable it by clicking on the toggle button 
in the Toolbar menu. It shouldn't break anything but as with all 
programs keep backups.

Regards, Pl

On 20.04.2016 , Bo Grimes wrote:
I don't like looking at the bottom of the screen all the time.  Hurts 
my neck for one. Since the physical structure of my desk prevents me 
from raising the monitor more than 3 inches off the desk (roll top), 
my other option is to resize my window to only go to half screen. I 
don't like that either, and can't in fullscreen mode.


I first discovered typewriter scroll with Scrivener, and would love to 
see a plug-in for Zim that can be turned on and off, like Sublime Text 
has.  See: https://github.com/alehandrof/Typewriter.


I have no idea how difficult this might be.  I am willing to pay 
$100.00 for the development of this plug-in, that also works in 
fullscreen mode and on both Windows and Linux versions.  That isn't 
much--unless it took 5 minutes and 10 lines of code--but all I could 
offer.  If multiple parties wished to cooperate to develop it, I could 
make it a donation to Zim instead or divide it equally across the 
developers, so I guess upfront coordination would be necessary to 
avoid duplication of time and effort.  It would need to be more than 
an Emacs M-x recenter, though even that is better than every word 
processor ever made.


I really don't know how supporting developers directly works, as I 
have only supported projects, so if I sound stupid or naive or it's 
too hard and I'm showing ignorance, you can mock me (but be gentle, 
please).  But if this is do-able and the list is an appropriate place 
to hammer it out or others also wish to support this then great!


Cheers,
Bo Grimes


# -*- coding: utf-8 -*-

# Copyright 2016 Pavel_M ,
# released under the GNU GPL (v2 or v3).
# This plugin is for Zim program by Jaap Karssenberg 
.

import gobject
import gtk

from zim.actions import toggle_action
from zim.plugins import PluginClass, extends, WindowExtension

import logging
logger = logging.getLogger('zim.plugins.ScrollToCenter')


class ScrollToCenterPlugin(PluginClass):

plugin_info = {
'name': _('ScrollToCenter'), # T: plugin name
'description': _('''\
This plugin automatically scrolls textview to keep typed text 
in the center.
'''), # T: plugin description
'author': 'Pavel_M',
'help': 'Plugins:ScrollToText',}


KEYVALS_SCROLL = map(gtk.gdk.keyval_from_name, ('Up', 'Down', 'Page_Up', 
'Page_Down'))
KEYVALS_ENTER = map(gtk.gdk.keyval_from_name, ('Return', 'KP_Enter', 
'ISO_Enter'))

@extends('MainWindow')
class ScrollToCenterExtension(WindowExtension):
uimanager_xml = '''






'''

def __init__(self, plugin, window):
WindowExtension.__init__(self, plugin, window)
self._textview = self.window.pageview.view
self._signal = None

def _enable(self):
if self._signal:
self._disable()
try:
self._signal = 
self._textview.connect('key-release-event', self._scroll)
except AttributeError:
logger.error('ScrollToCenter: plugin is not 
initialized.')

def _disable(self):
if self._signal:
self._textview.disconnect(self._signal)
self._signal = None

def teardown(self):
self._disable()

def _scroll(self, textview, event):
if (event.keyval in KEYVALS_SCROLL \
and not event.state & gtk.gdk.SHIFT_MASK) \
or event.keyval in KEYVALS_ENTER:
buffer = self._textview.get_buffer()
self._textview.scroll_to_mark(buffer.get_insert(), 
within_margin = 0.0,
use_align=True, 
xalign=0.0, yalign=0.5)

@toggle_action(_('Enable Scrolling'), stock = gtk.STOCK_GOTO_BOTTOM,
tooltip = 'Enable Scrolling') # T: menu item
def toggle_scrolling(self, active):
if active:
self._enable()
else:
self._disable()


___
Mailing list: