Style generator

21 views
Skip to first unread message

Maxime R

unread,
Apr 23, 2008, 3:39:22 PM4/23/08
to zotero-dev
hello
I am working on a style generator:

http://www.somwhere.org/demo/

it does not allow the bibliography multiple: like article+ book
+chapter;

i must add few options for authors-like citation but it works (I
hope).

If you want help me, test, comment..... i'll be happy

Thanks

Maxime Rigo

Jon Lesser

unread,
Apr 24, 2008, 4:28:46 PM4/24/08
to zoter...@googlegroups.com
Hi Maxime,

This looks pretty cool.

I'm working on developing some new things for zotero.org. Some of the
things we've been thinking about related to styles are:

-how to present existing styles
-how to allow people to contribute new styles
-how to allow people to comment on and correct existing styles
-how to allow people to make their own styles with a minimum of fuss

I couple months back, Bruce wrote up a proposal with ideas for a CSL
GUI (http://tinyurl.com/6eg453). It's interesting to see how you've
worked through the UI issues. It's great to see so much interest in a
style editors.

Best,
Jon

Max R

unread,
Apr 25, 2008, 6:36:45 AM4/25/08
to zoter...@googlegroups.com
Hi Jon
Thanks.

This script if my first step in this csl maker. The Bruce ideas are really good but i'm not got enough  to make something like this.
i'm using javascript for two reasons:
   - i don't know other language
   - it allow the generator working without internet connexion  because you never had internet when you need it.

My focus is to make a working editor, simple. One problem of my approach is that i don't generate good macro in the style so the csl files  is "dirty".

This first version is working but it needs few more options in the authors like citation.
With the first feed back i have and after read again Bruce ideas i'm currently working on a new version more simple for the user.
Maybe i could give a preview this week.

Zotero is really fantastic.

Best.

Maxime

Best

2008/4/24, Jon Lesser <jonl...@gmail.com>:

Maxime R

unread,
May 27, 2008, 11:12:38 AM5/27/08
to zotero-dev
Hello

You can found here: http://www.somwhere.org/csl/ a new version of the
generator.
- i hope more user friendly
- it use macro so you can manage different citation format for book
article etc...

i've test it a lot but there is maybe few problems if someone want
test...

best

Maxime Rigo
Message has been deleted

Bruce D'Arcus

unread,
May 27, 2008, 11:42:27 AM5/27/08
to zoter...@googlegroups.com, development discussion for xbiblio


Showing *really* nice progress! I'd encourage everyone (and
particularly Jon L.) to bang on this as much as possible, as it's a
good start, and the more real world testing, the better it will be.

Just a couple of things, broken down by steps:

1) categories should not be a simple text field, or they at least
shouldn't be free text.

2) "author-like" choice is confusing. In both cases, I'd find some way
to present a simple preview.

What does "choose a model" mean? Is the macros?

What is "If collapse delimiter between citations" and what should the
user enter?

On et-al options, keep in mind that some styles (like APA) have
different rules for first and subsequent. Also, the CSS should have a
rule for when hovering such that the user can see they can click it.
Probably don't need "click me"

On the last step, this is also looking really nice. Am I correct that
the list on the left size is accessing macros? If as I assume, yes,
then excellent!

The output is a little verbose and there are lots of empty attributes.
Would be good for you to test and omit those where possible.

A more important issue is: do you validate the style at the end? The
id, for example, is invalid. It needs to be a URI.

Finally, on the instructions:

" * - Click on "Generate" to make your style.
* - Copy past the result in a new text file and change the
extention for "my-style.csl".
* - To install the style open this file with Firefox."

I think these needs to be changed. The user should not be touching the
styles AT ALL. Rather, they should first see a generated list of
citations and references to see if the style works as they expect.
This will be easier once citeproc-php is done.

They should then have a link that allows them to click it to
automatically a) install in Zotero (or whatever other future tool they
use) and b) stores it in a repository.

Maxime: is your code available somewhere in a repository if others
should want to pick up on it?

Bruce

Bruce D'Arcus

unread,
May 27, 2008, 11:45:55 AM5/27/08
to zoter...@googlegroups.com
Another minor point: why not use JQuery for the UI stuff?

Bruce

Sean Takats

unread,
May 27, 2008, 12:31:52 PM5/27/08
to zoter...@googlegroups.com
Hi Maxime,

Thank you for working on this style generator. I really like the move
toward something more like a wizard. One thing that might really help
users, especially novices, would be some examples of what "numbered"
and "author-like" styles look like before one has to make a decision.
Another possibility might be to allow users to select from a group of
representative styles one that's close to what they want. Then they
could use your editing interface to make the style conform to the
desired output. Thanks again for your hard work.

Best regards,

Sean Takats
Acting Director of Research Projects
Center for History and New Media, George Mason University
sta...@gmu.edu | http://chnm.gmu.edu | 703 993 9271


On May 27, 2008, at 11:12 AM, Maxime R wrote:

>
> Hello


>
> You can found here: http://www.somwhere.org/csl/ a new version of the
> generator.
> - i hope more user friendly
> - it use macro so you can manage different citation format for book
> article etc...
>
> i've test it a lot but there is maybe few problems if someone want
> test...
>

> best
>
> Maxime Rigo
> >

Max R

unread,
May 27, 2008, 5:20:59 PM5/27/08
to zoter...@googlegroups.com
Thanks for your comments i will try to answer to every elements




1) categories should not be a simple text field, or they at least
shouldn't be free text.

You are right i can change the text field to a list but we must define witch category could be avaible
 

2) "author-like" choice is confusing. In both cases, I'd find some way
to present a simple preview.

Before i was using predefined "authors" citations but there is too much cases. if you have suggestions i take. 


What does "choose a model" mean? Is the macros?

For numeric citations it's to use predefined macros
For author citation it's to add or not in the macro the year, i 'll think for somthing more explicit 


What is "If collapse delimiter between citations" and what should the
user enter?

 it add a delimiter in the citation layout but i maybe i had misunderstood this part
 
 


On et-al options, keep in mind that some styles (like APA) have
different rules for first and subsequent. Also, the CSS should have a
rule for when hovering such that the user can see they can click it.
Probably don't need "click me"

i can change for a mouseover but i don't think when there is a lot of choice it's be easier an exemple:

 


  Am I correct that
the list on the left size is accessing macros? If as I assume, yes,
then excellent!

Every elements of the script write in macro except the bibliographic order  preffix and suffix  because it was easier for me adding them in the bibliography part. I can change that.


The output is a little verbose and there are lots of empty attributes.
Would be good for you to test and omit those where possible.

Yes i don't test every empty field, step by step i 'll fix that
 

A more important issue is: do you validate the style at the end?

No there is no control  the only one it's me I've try to test maximum of csl file to see if something break the csl installation
 
The
id, for example, is invalid. It needs to be a URI.

Yes for the moment this block the zotero preview panel , witch URl can i use?
 



  Rather, they should first see a generated list of
citations and references to see if the style works as they expect.
This will be easier once citeproc-php is done.

Now i am not able to code that but i know it will be easier for the user.


 


  a) install in Zotero (or whatever other future tool they
use) and b) stores it in a repository.

Yes i'm trying to do that but i need use php and my "php for dummies" must be here in two days.




 

Maxime: is your code available somewhere in a repository if others
should want to pick up on it?

I have no repository but i can quickly add a link to a compress folder with all files. But beware my code is ugly and i must add more comment , this is my first code so be indulgent.

To be honnest i don't use JQuery because i've discover it yesterday.



One thing that might really help
users, especially novices, would be some examples of what "numbered"
and "author-like" styles look like before one has to make a decision.

Good idea: it's done

 Best
 Maxime

Bruce D'Arcus

unread,
May 28, 2008, 11:39:12 AM5/28/08
to zoter...@googlegroups.com
On Tue, May 27, 2008 at 5:20 PM, Max R <lem...@gmail.com> wrote:

>> 1) categories should not be a simple text field, or they at least
>> shouldn't be free text.
>
> You are right i can change the text field to a list but we must define witch
> category could be avaible

It's in the schema:

<http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/csl/schema/trunk/csl.rnc?view=log>

## Add one or more field categories. The "generic-base" category
is reserved
## for the handful of truly generic styles (APA, Harvard, etc.)
from which most descend.
info-fields =
"anthropology"
| "astronomy"
| "biology"
| "botany"
| "chemistry"
| "communications"
| "engineering"
| "generic-base"
| "geography"
| "geology"
| "history"
| "humanities"
| "literature"
| "math"
| "medicine"
| "philosophy"
| "physics"
| "psychology"
| "sociology"
| "science"
| "political_science"
| "social_science"
| "theology"
| "zoology"
| info-categories.extension
info-classes = "author-date" | "numeric" | "label" | "note" | "in-text"

>> 2) "author-like" choice is confusing. In both cases, I'd find some way
>> to present a simple preview.
>
> Before i was using predefined "authors" citations but there is too much
> cases. if you have suggestions i take.

I just mean reading the phrase "author-like" without any other
information (like a preview) is confusing.

>> What does "choose a model" mean? Is the macros?
>
> For numeric citations it's to use predefined macros
> For author citation it's to add or not in the macro the year, i 'll think
> for somthing more explicit
>>
>>
>> What is "If collapse delimiter between citations" and what should the
>> user enter?
>
> it add a delimiter in the citation layout but i maybe i had misunderstood
> this part
>
>
>>
>> On et-al options, keep in mind that some styles (like APA) have
>> different rules for first and subsequent. Also, the CSS should have a
>> rule for when hovering such that the user can see they can click it.
>> Probably don't need "click me"
>
> i can change for a mouseover but i don't think when there is a lot of choice
> it's be easier an exemple:
>
>
>>
>> Am I correct that
>> the list on the left size is accessing macros? If as I assume, yes,
>> then excellent!
>
> Every elements of the script write in macro except the bibliographic order
> preffix and suffix because it was easier for me adding them in the
> bibliography part. I can change that.

It makes sense that the prefix and suffix is a part of the context of
the list, rather than of the macro. Otherwise, you'd need too many
macros.

>> The output is a little verbose and there are lots of empty attributes.
>> Would be good for you to test and omit those where possible.
>
> Yes i don't test every empty field, step by step i 'll fix that
>
>>
>> A more important issue is: do you validate the style at the end?
>
> No there is no control the only one it's me I've try to test maximum of csl
> file to see if something break the csl installation
>
>>
>> The
>> id, for example, is invalid. It needs to be a URI.
>
> Yes for the moment this block the zotero preview panel , witch URl can i
> use?

I think there should be a "base_uri" variable, which would be the
repository home. For Zotero, for example, that base uri would be
"http://zotero.org/styles/". The id should then be generated by
appending a slug to the end of that base uri.

>> Rather, they should first see a generated list of
>> citations and references to see if the style works as they expect.
>> This will be easier once citeproc-php is done.
>
> Now i am not able to code that but i know it will be easier for the user.

Right, it's not that easy.

>> a) install in Zotero (or whatever other future tool they
>> use) and b) stores it in a repository.
>
> Yes i'm trying to do that but i need use php and my "php for dummies" must
> be here in two days.

:-)

Bruce

Max R

unread,
May 28, 2008, 7:03:14 PM5/28/08
to zoter...@googlegroups.com
Ok last changes:

- The category is now a list.
- Id is fix, but "a slug to the end of that base uri" oops how do that?
- The csl file is generate in a repository and user only need download it ( direct installation don't work , i suppose is due to the Id problem) This repository will be erase every week or day i don't know now.

Todo:
- add tests in the script to reduce none used elements ( ex: form="" or text-case="").
- clean code and add more comments.
- add more examples in the options, specially in bibliographic authors options (if you have idea....).

If you don't have new problems i'll post it on the forum.

Best
Maxime



Bruce D'Arcus

unread,
May 28, 2008, 8:05:00 PM5/28/08
to zoter...@googlegroups.com
On Wed, May 28, 2008 at 7:03 PM, Max R <lem...@gmail.com> wrote:
> Ok last changes:
>
> - The category is now a list.
> - Id is fix, but "a slug to the end of that base uri" oops how do that?

You need a slugify function that takes a string (the title) and
creates a URL-friendly token. I don't do PHP, but something like this:

<http://scotfl.ca/blog/2007/02/26/of-slugs-and-permalinks-and-php/>

Even better might be to borrow some Javascript code from the Django
project. In their admin interface, you can configure fields to
automatically create the slug as the user types the string on which
it's based. This is quite nice from a user perspective.

<http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/media/js/urlify.js>

> - The csl file is generate in a repository and user only need download it (
> direct installation don't work , i suppose is due to the Id problem)

Also, you need to serve the file with the correct mime-type. See how
Zotero does it on their server.

> This repository will be erase every week or day i don't know now.

You mean while you're developing it? Long-term we need (proably more
than one) long-term repositories so people don't have to create styles
;-)

Bruce

Dan Stillman

unread,
May 28, 2008, 8:05:56 PM5/28/08
to zoter...@googlegroups.com
On 5/28/08 7:03 PM, Max R wrote:
> - The csl file is generate in a repository and user only need download
> it ( direct installation don't work , i suppose is due to the Id
> problem) This repository will be erase every week or day i don't know now.

You can offer a Zotero install link by serving the CSL with the MIME
type text/x-csl. In PHP you'd do this with the following line:

header('Content-type: text/x-csl');

Before we start having users install these, though, we probably need to
think more about the ids generated by a tool like this. For starters,
you probably want to generate URIs without capital letters or
parentheses. Also, at the moment, if two people give a style the same
name, it'll have the same id, even if the download URL is different, and
installing one will replace the other. But this tool is fundamentally
different from a long-term repository, so it may be better to use either
A) randomly generated ids that are guaranteed not to conflict or B) a
single consistent somwhere.org id that will always be replaced, such
that users would have at most one such test style from this tool in
their clients. Either way, once they were sure it worked properly they
could submit it to a repository like Zotero's, where the URI could be
adjusted for permanent storage. Not sure what's best.

Two other small things: you need an ISO 8601 date in the <updated/>
field for the generated styles to be valid, and it might be helpful to
generate indented XML. In PHP, you can use the formatOutput option of
the PHP DOM functions to do this.

- Dan

Bruce D'Arcus

unread,
May 28, 2008, 8:30:52 PM5/28/08
to zoter...@googlegroups.com
On Wed, May 28, 2008 at 8:05 PM, Dan Stillman <dsti...@zotero.org> wrote:

> Also, at the moment, if two people give a style the same
> name, it'll have the same id, even if the download URL is different, and
> installing one will replace the other. But this tool is fundamentally
> different from a long-term repository, so it may be better to use either
> A) randomly generated ids that are guaranteed not to conflict or B) a
> single consistent somwhere.org id that will always be replaced, such
> that users would have at most one such test style from this tool in
> their clients. Either way, once they were sure it worked properly they
> could submit it to a repository like Zotero's, where the URI could be
> adjusted for permanent storage. Not sure what's best.

It seems to me your right this all (style creation and long-term
hosting) ought to be thought of together. The goal, as I've said
repeatedly, should be that ultimately users never have to think about
citation styles; they just choose what they need. But cutting down on
duplication work requires people being able to easily see what's
currently available.

Whatever happened to the work that Jon was doing? Seems to me some of
this ought to be able to dovetail nicely.

Bruce

Max R

unread,
May 29, 2008, 4:49:15 PM5/29/08
to zoter...@googlegroups.com
Ok i've add date in <updated>

For the repository i think my script is not made for that:
the major lack is that user can't visualize/check the style before install it on zotero and i can't check witch style generate is a good style and witch one is only generate for test.
I think user generate his style with this script and if it's ok submit in zotero's repository. It will be an error having multiple repository for end user. 

that ultimately users never have to think about
citation styles; they just choose what they need

i'm agree , i've made this to help making a critical number of citation style to end user.


Whatever happened to the work that Jon was doing?

For me there is no change, my script is not perfect he don't use all csl capability , using javascript was good but not enought. We can stop using my script when Jon's work is ready



Jon Lesser

unread,
May 30, 2008, 6:57:55 PM5/30/08
to zoter...@googlegroups.com
Hi All,

Sorry for my recent radio silence. Things have just been busy.

Thanks Max for sticking with this. The latest version shows a lot of
improvements.

Here are some thoughts and suggestions on the interface:

-- Move step 1 to the end. Let people get into the process of making
the style right away and worry about naming and categorizing at the end.

-- In safari 3.1.1, the last step comes up with no content below the
header. Use a javascript library like jQuery can help to mitigate
against inconstancies across browsers. Of course, firefox
functionality is obviously the most important.

-- Set defaults for all the options. If I just click next through
everything, I should have usable a style at the end. Perhaps ask at
the beginning which citation format they want to start with and set
the defaults to that style. It seems most styles people would want to
make are just minor deviations from a more standard style, so if they
can start with a standard style it should cut down on the amount of
work they have to do.

-- Open all of the citation options boxes instead of having to click
on the header bar to get to them.

-- Some sort of progress indicator is always a nice thing. For
example, if there are three steps, make a symbol for each of the steps
and indicate which step the person is currently at. This can also be
used as a navigation between steps. See for example http://ui-patterns.com/pattern/StepsLeft
or even something as simple as a tabbed box where each tab is a step.

-- Instead of having a button to generate the style at the last step,
just generate it when you get to the last step. If the option to name
and categorize the style is moved to the end, have the user enter that
information and then click generate.

-- Getting the mime type set so people just click the link, rather
than saving and installing sounds like a good idea.

The next part of this post is somewhat somewhat unrelated to Max's csl
editor, but I wanted to give people a sense of what I'm working on and
how it might integrate with Max's csl editor. In the last couple
weeks, I've been working on mapping out features for the next Zotero
website. There are two primary components:

1) "Zotero Central" (we don't really have a name for this yet) where
Zotero users will be able to login and see their collections, do some
social networking things like engage in groups, maintain profiles,
etc., and perform searches across the site. The next steps for me are
to convert our feature brainstorming from post-it notes to a document
that can shared more easily.

2) The Zotero firefox extension and related support. The is
essentially the existing zotero.org with the addition of functionality
to store, maintain, complain about, and praise translators, styles,
and plugins. My efforts thus far have been focused on translators. The
scope of my personal ambitions right now does not include a gui CSL
editor within the next few months (however, priorities can change).
Rather, I'm more interested in making a sort of repository where
people can upload new styles as well as browse and install existing
styles. So this could serve as a persistent storage for styles
generated with Max's tool or by any other means. The ui would br
geared towards people looking for styles, with just enough support for
style creators to upload, update, and respond to people using their
style. Decoupling style creation from browsing and installing styles
seems like a good idea, at least to me.

Unfortunately, I don't have a set of wireframes ready to go for the
styles related part of the website. I had planned to have this done a
while ago. I will get something out to the list when I can. My current
Zotero related priority is to code up a system for user accounts with
a couple authentication methods. This will be the used for both
components I just discussed as well as an for an upcoming Zotero 1.5
preview/beta/pre-release release that supports some syncing.

Jon

Bruce D'Arcus

unread,
May 30, 2008, 7:37:53 PM5/30/08
to zoter...@googlegroups.com
Hi Jon,

On Fri, May 30, 2008 at 6:57 PM, Jon Lesser <jonl...@gmail.com> wrote:

> Here are some thoughts and suggestions on the interface:
>
> -- Move step 1 to the end. Let people get into the process of making
> the style right away and worry about naming and categorizing at the end.

My personal opinion is this only makes sense if the process of
gathering that information does not impact the UI. My assumption has
always been that it can, and it should. For example, science people
don't use note-based styles. Humanities people don't use numeric
styles. The UI should know that and take it into account.

Also, typing the title in could be tied into a system to identify
whether the style already exists (to avoid duplication).

> -- In safari 3.1.1, the last step comes up with no content below the
> header. Use a javascript library like jQuery can help to mitigate
> against inconstancies across browsers. Of course, firefox
> functionality is obviously the most important.

To Zotero, yes, but not to the long-term success of CSL.

> -- Set defaults for all the options. If I just click next through
> everything, I should have usable a style at the end. Perhaps ask at
> the beginning which citation format they want to start with and set
> the defaults to that style. It seems most styles people would want to
> make are just minor deviations from a more standard style, so if they
> can start with a standard style it should cut down on the amount of
> work they have to do.

Right, as I say above, you need to ask some basic info at the
beginning, such as type of style ("author", "author-date", "label",
"numeric", "note with bibliography" and "note without bibliography")
would be sensible.

My view has always been that the second pane/screen would have the
choose select the base style which is closest to the desired styles.
For example, if they choose an "author-date" style, they might see
options for APA, Chicago, and Harvard. They select one, and that
configures all the defaults.

> -- Open all of the citation options boxes instead of having to click
> on the header bar to get to them.
>
> -- Some sort of progress indicator is always a nice thing. For
> example, if there are three steps, make a symbol for each of the steps
> and indicate which step the person is currently at. This can also be
> used as a navigation between steps. See for example http://ui-patterns.com/pattern/StepsLeft
> or even something as simple as a tabbed box where each tab is a step.

+1

While I agree that the two functions ought to be able to stand on
their own, neither is ideal without the other.

Example: a user searches for a style in the new Zotero Central
repository. They don't find it, but find one that's almost exactly the
same. Why should they have to go through the trouble of going to
another site, deal with another interface, and not bring any of the
information from the first one over? Likewise, who wants to hassle
with creating new styles if the one they want already exists?

I realize there are resource constraints that make this difficult, but
I have to wonder if there's some way to structure development in such
a way that a) others can contribute where appropriate, and b) that the
CSL interface work could be easily folded into the repository
functionality?

It seems to the degree that Maxime can rely on clean Javascript
(probably using JQuery), the easier this would be.

But what else is there to do?

Bruce

Max R

unread,
Jun 2, 2008, 5:36:48 AM6/2/08
to zoter...@googlegroups.com
Hello



In safari 3.1.1, the last step comes up with no content below the
header. Use a javascript library like jQuery can help to mitigate
against inconstancies across browsers.

Ok i have test only with opera and firefox i will fix that in a next version but i have some difficulty with Jquery


Set defaults for all the options. If I just click next through
everything, I should have usable a style at the end.

Right, as I say above, you need to ask some basic info at the
beginning, such as type of style ("author", "author-date", "label",
"numeric", "note with bibliography" and "note without bibliography")
would be sensible. 

options are already on defaults expect bibliography order. to do that i must identify all options  from this  6 general models in a database and when one is selected the defaults options are configure. User only change what he need. Other solution is using the style preview http://www.zotero.org/styles/  but it will ask a lot of work to make a database



Open all of the citation options boxes instead of having to click
on the header bar to get to them.

I've change for a mouse over event everywhere but i 'll change that

Some sort of progress indicator is always a nice thing. For
example, if there are three steps, make a symbol for each of the steps
and indicate which step the person is currently at. This can also be
used as a navigation between steps.
i currently working on , with tabs elements and no decorations.

Instead of having a button to generate the style at the last step,
just generate it when you get to the last step

-- Getting the mime type set so people just click the link, rather
than saving and installing sounds like a good idea

I will change that. Mime type is done  but the style appear invalid so i prefer don't use it now


Before i try make a new version using basic info to help user i must better understand how make better style, for exemple i must understand how making footnotes ,or think how integrate <substitute> etc...


Max

2008/5/31 Bruce D'Arcus <bda...@gmail.com>:

Bruce D'Arcus

unread,
Jun 2, 2008, 8:04:45 AM6/2/08
to zoter...@googlegroups.com
On Mon, Jun 2, 2008 at 5:36 AM, Max R <lem...@gmail.com> wrote:

>> In safari 3.1.1, the last step comes up with no content below the
>> header. Use a javascript library like jQuery can help to mitigate
>> against inconstancies across browsers.
>
> Ok i have test only with opera and firefox i will fix that in a next version
> but i have some difficulty with Jquery

What "difficulty"?

>> Set defaults for all the options. If I just click next through
>> everything, I should have usable a style at the end.
>
>> Right, as I say above, you need to ask some basic info at the
>> beginning, such as type of style ("author", "author-date", "label",
>> "numeric", "note with bibliography" and "note without bibliography")
>> would be sensible.
>
> options are already on defaults expect bibliography order. to do that i must
> identify all options from this 6 general models in a database and when one
> is selected the defaults options are configure. User only change what he
> need. Other solution is using the style preview
> http://www.zotero.org/styles/

These aren't mutually exclusive. Get the basics right, and then make
it easy to add previewing later.

>> -- Getting the mime type set so people just click the link, rather
>> than saving and installing sounds like a good idea
>
> I will change that. Mime type is done but the style appear invalid so i
> prefer don't use it now

You MUST create valid styles or you're just going to create problems.

> Before i try make a new version using basic info to help user i must better
> understand how make better style, for exemple i must understand how making
> footnotes ,or think how integrate <substitute> etc...

I'd constrain substitute logic to macros.

Bruce

Bruce D'Arcus

unread,
Jun 2, 2008, 8:20:53 AM6/2/08
to zoter...@googlegroups.com
BTW, I'd remove the "generic-base" category option. The purpose of
this is to define a small number of base styles (APA, Chicago, etc.),
which wouldn't really be the purpose of the generator. It also might
be confusing.

Bruce

Max R

unread,
Jun 2, 2008, 11:34:15 AM6/2/08
to zoter...@googlegroups.com
What "difficulty"?
I understand how using tabs, but show/hide <div> is different than actually i used. i must test with jquery

You MUST create valid styles or you're just going to create problems.

In fact the csl file is valid. I was trying add a link to directly install the style but there was an error during xml generation now it's ok.
I don't add this now because i  am  cleaning script to release

it's done

Owen

unread,
Jun 2, 2008, 1:28:53 PM6/2/08
to zotero-dev
Wow really great to see how quickly the development of Zotero is
going.

I was just wondering if someone was working on a style generator, and
lo and behold, someone is! Thanks!

FYI, the CSL file I made my first try has this error when I try to
import it into Zotero:

XML Parsing Error: not well-formed
Location: file:///Virology%20(author%20date)-7-15-06-02-08.csl
Line Number 63, Column 47:<name font-weight="normal" font-
style="normal"initialize-with="." />
----------------------------------------------^

Looks like it's just missing a space after the "normal" ?

Max R

unread,
Jun 2, 2008, 1:42:18 PM6/2/08
to zoter...@googlegroups.com
Hello thanks for your report.
You are right the space is missing. I've update the script

Best
 Maxime



2008/6/2 Owen <jun...@gmail.com>:

Dan Stillman

unread,
Jun 2, 2008, 1:50:14 PM6/2/08
to zoter...@googlegroups.com
On 6/2/08 1:42 PM, Max R wrote:
> Hello thanks for your report.
> You are right the space is missing. I've update the script

You might consider using PHP's various XML functions rather than
generating the XML by concatenating strings, which it seems like you're
doing at the moment. At the very least, you should make sure that you're
outputting valid XML and validating the styles against the RELAX-NG
schema, which you can do in PHP (see
http://www.php.net/manual/en/domdocument.relaxngvalidate.php), though it
may or may not be available in your build. It's better to display an
error and send yourself an alert e-mail than to generate invalid styles.

Bruce D'Arcus

unread,
Jun 3, 2008, 12:00:41 PM6/3/08
to zoter...@googlegroups.com
On Mon, Jun 2, 2008 at 1:50 PM, Dan Stillman <dsti...@zotero.org> wrote:

> On 6/2/08 1:42 PM, Max R wrote:
>> Hello thanks for your report.
>> You are right the space is missing. I've update the script
>
> You might consider using PHP's various XML functions rather than
> generating the XML by concatenating strings, which it seems like you're
> doing at the moment.

+1.

What would be the preferred way to program this in PHP? Using what
library, taking what approach? I presume some sort of "to_xml"
serialization function that take some PHP arrays?

Hmm .. strikes me that at some point the same code that can read a CSL
file to configure formatting also ought to be usable for creating
them?

> At the very least, you should make sure that you're
> outputting valid XML and validating the styles against the RELAX-NG
> schema, which you can do in PHP (see
> http://www.php.net/manual/en/domdocument.relaxngvalidate.php), though it
> may or may not be available in your build. It's better to display an
> error and send yourself an alert e-mail than to generate invalid styles.

Yes, yes, yes; just want to underline this.

Great to see PHP includes RNG support.

Bruce

Dan Stillman

unread,
Jun 3, 2008, 2:57:02 PM6/3/08
to zoter...@googlegroups.com
On 6/3/08 12:00 PM, Bruce D'Arcus wrote:
> On Mon, Jun 2, 2008 at 1:50 PM, Dan Stillman <dsti...@zotero.org> wrote:
>
>> You might consider using PHP's various XML functions rather than
>> generating the XML by concatenating strings, which it seems like you're
>> doing at the moment.
>>
>
> +1.
>
> What would be the preferred way to program this in PHP? Using what
> library, taking what approach? I presume some sort of "to_xml"
> serialization function that take some PHP arrays?
>

There are a bunch of options, but SimpleXML
(http://www.php.net/manual/en/book.simplexml.php) lets you use
manipulate XML more or less the same way you manipulate regular PHP
objects and arrays.

RELAX NG validation is only in the DOMDocument class, though, so if you
use SimpleXML you have to use dom_import_simplexml() to get a DOM node
and import it into a DOM document. When you're done, you can generate an
XML string from a DOM document with $domdoc->saveXML().

Of if you prefer the DOM syntax, you can use DOMDocument all the way.

Each class has its quirks, so one would want to be sure to read the
php.net comments and look at the examples before starting out.

Max R

unread,
Jun 20, 2008, 11:05:21 AM6/20/08
to zoter...@googlegroups.com
Some news of the project.

The UI won't change a lot , i add tabs as you suggest before. I'm adding one step where user can choose between "author; author-date; numbered; full note with bibliography , note with bibliography; full note without bibliography"
This choice will help to make the citation part.

All the code is now in php and verify if the xml is valid. I'm currently making differents functions to generate the style like a puzzle

Max

2008/6/3 Dan Stillman <dsti...@zotero.org>:
Reply all
Reply to author
Forward
0 new messages