Scribusoid

Author Topic: Can i gather text into Scribus without leaving my web browser?  (Read 1988 times)

vek.m1234

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
  • Scribus User
Can i gather text into Scribus without leaving my web browser?
« on: October 22, 2013, 07:26:12 am »
Hi,
I use Firefox on Linux (Debian). Is it possible for me to read the Wikipedia and select snippets of text and have the text injected into Scribus, auto-magically, using a named pipe that Scribus reads.

Once these objects of data have accumulated in Scribus with some default formatting (font size, weight, family), I could go into Scribus and manipulate (merge, position, highlight, resize, decorate [boxes]) these objects on the Scribus canvas.

This feature is useful for producing notes - reading from the wiki can be very voluminous and i need to get rid of the verbosity and just keep the salient points:-
Eg:
https://en.wikipedia.org/wiki/Set_%28mathematics%29
set is a well *defined* collection of *distinct* objects.
C = {4, 2, 1, 3}
set-builder notation,

I'll have to insert an arrow box to highlight what i mean by "defined" which will be in a bold font. The initial content will just be a hodge-podge of snippets that i've gathered while reading the article, which i'll then need to group and decorate. "Zemelo-Frankel" will be moved to the bottom corner of my sheet - I may want to group content(snippets) from another web page on "Sequences" and "Tuples" with my set definition to contrast them for easy memory..

I feel it can't be too difficult to implement because initially you'd be just slurping text from the pipe and dumping it into objects that could be positioned one after another (non overlapping) on the canvas with some default formatting info. And then, i'd just need to use Scribus in the usual way to sort out the blobs of data..


The firefox plugin is easy to write using addon-sdk-1.14:
var file = require("sdk/io/file");
var fh = file.open('/tmp/foo', 'w');


function myListener() {
  console.log(selection.text);
  fh.write(selection.text);
  fh.write(" ");
  fh.flush();
 
};

var selection = require("sdk/selection");
eslection.on('select', function () { myListener(fh); });

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2125
  • Karma: 27
    • the graphics lab
Re: Can i gather text into Scribus without leaving my web browser?
« Reply #1 on: October 22, 2013, 02:01:38 pm »
what you can try to do, is a python script that you let run inside of scribus.

it would block scribus itself, read from some sort of pipe, and create text frames on the fly.

but, all in all, you should probably rather create a text file that is filled by your firefox plugin and write a small scribus (python) script that reads and empties that file.

ciao
a.l.e