Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

ProleWiki:User guide/Library: Difference between revisions

From ProleWiki, the proletarian encyclopedia
More languages
No edit summary
Tag: Visual edit
 
(17 intermediate revisions by the same user not shown)
Line 13: Line 13:
In the screenshot, we see for example "Marxist-Leninist authors". This is one topic which appears on the library page. It's simply created with a '''Heading''' (level 1 heading).
In the screenshot, we see for example "Marxist-Leninist authors". This is one topic which appears on the library page. It's simply created with a '''Heading''' (level 1 heading).


===Cards===
===Cards (or full size cards)===
Inside each topic, there are ''cards'' (Stalin, Lenin in the screenshot) that are about a '''category'''. These cards are added with the [[Template:Library card]].
Inside each topic, there are ''cards'' (Stalin, Lenin in the screenshot) that are about a '''category'''. These cards are added with the [[Template:Library card]].


If you click on Stalin, for example, you will be taken to the page [[:Category:Library works by Joseph Stalin]]. You can change the name of the card to be whatever you want, but we'll go over that in the next section.
If you click on Stalin, for example, you will be taken to the page [[:Category:Library works by Joseph Stalin]]. You can change the name of the card to be whatever you want, but we'll go over that in the next section.
A full-sized card like the one for Stalin links to a category page, it cannot link to anything else.
We generally want to use those cards for our biggest or "main" authors that are near the top of the page, so it's unlikely you'll actually have to use the full-size cards.
=== Mini cards ===
We also added "mini cards" because some thought the cards themselves took too much space. They are made with the [[Template:Library card mini]].
These cards are similar to the full-format cards but take more parameters because they can link to anything. See next chapter below to learn how to use the card.


===Overall organisation===
===Overall organisation===
Line 24: Line 33:


==How to add something to the library==
==How to add something to the library==
We recommend working on the library with the '''source editor''', as the visual editor is a bit messy with it.
You need to work on the library with the '''source editor''', as the visual editor will mess it up.


===Adding a topic===
===Adding a topic===
==== Full-size cards ====
To add a topic, you simply need to add a heading (level of your choice) on the page. Then, you should add <nowiki><div class="library-container"></div></nowiki> right under it. It will look like this:
To add a topic, you simply need to add a heading (level of your choice) on the page. Then, you should add <nowiki><div class="library-container"></div></nowiki> right under it. It will look like this:
  == Marxist-Leninist authors ==
  == Marxist-Leninist authors ==
Line 35: Line 46:


If this is complicated for you, you can simply copy another section of the library in the source editor and paste it to the topic you want to create.
If this is complicated for you, you can simply copy another section of the library in the source editor and paste it to the topic you want to create.
==== Mini cards ====
To add a mini card section to the library, it's the same code but with '''<nowiki><div class="library-container-mini"></nowiki>''' instead. (just add the -mini to the div class).
You still have to close the div, and only mini cards should go in there.


===Adding a card===
===Adding a card===
==== Full-size card ====
Next, as you can see from the code above, you need to add the card ''template'' to your topic section.
Next, as you can see from the code above, you need to add the card ''template'' to your topic section.


Line 46: Line 64:
*'''name:''' name you want to appear on the card. Can be anything.
*'''name:''' name you want to appear on the card. Can be anything.
*'''top and left:''' Optional fields. You can offset the picture vertically and horizontally (in pixels) so it's properly aligned in the card. I recommend using very small digits like 5 or 10.
*'''top and left:''' Optional fields. You can offset the picture vertically and horizontally (in pixels) so it's properly aligned in the card. I recommend using very small digits like 5 or 10.
And it will look like this:
{{Library_homepage}}
<div class="library-container">
{{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}
</div>
There's no limits to the number of cards you can add under every topic, but it's good practice to linebreak after every card you add. This is how a topic looks like after it's filled out:
There's no limits to the number of cards you can add under every topic, but it's good practice to linebreak after every card you add. This is how a topic looks like after it's filled out:
  == Marxist-Leninist authors ==
  <nowiki>== Marxist-Leninist authors ==
  <nowiki><div class="library-container"></nowiki>
  <div class="library-container">
  <nowiki>{{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}</nowiki>
  {{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}
  <nowiki>{{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}</nowiki>
  {{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}
  <nowiki>{{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}</nowiki>
  {{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}
  <nowiki></div></nowiki>
</div></nowiki>
 
==== Mini card ====
You use the mini card template like this:
 
  <nowiki>{{Library card mini|name=Rosa Luxemburg|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}</nowiki>
 
Which will look like this:
{{Library_homepage}}
<div class="library-container-mini">
{{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]|name=Rosa Luxemburg}}
</div>
 
There are more parameters (image, text, etc) in this template than on the full-size card. Here they are explained:
{| class="wikitable"
|+
!Parameter
!Documentation
|-
|image
|The image you want to use for this card. Upload it, then copy the entire filename over (with the extension)
|-
|link
|The link you want the image to redirect to. Should be the same link as in the text, and you should also use the brackets <nowiki>[[</nowiki> for it to work.
|-
|name
|The name for the Table of Content entry, so that the mini card is searchable on the TOC.
|-
|text
|Finally, the text you want to appear next to the card (above is Library works by Rosa Luxemburg). You have around 12-14 words available (3 lines) which should be more than enough; if you type in too many words, the card will look wrong, giving you a signal to reduce the word count.
|}
 
To add a link to a category, wrap it in [[ ]] as normal on the source editor, but don't forget to add a colon (:) before Category -- see the code above.
 
Adding mini-cards on the library page will look just like this:
 
<nowiki>
<div class="library-container-mini">
{{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=[[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}
{{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}
{{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}
{{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}
<{{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}
</div>
</nowiki>


=== Adding categories to works ===
=== Adding categories to works ===
Finally, we need to add categories to works. Categories are a ''namespace''; refer to the [[ProleWiki:User guide#Understanding namespaces|user guide]] if you need help on that.
Finally, we need to add categories to works. Categories are a ''namespace''; refer to the [[ProleWiki:User guide#Understanding namespaces|user guide]] if you need help on that.


To add a category to a work, you first need to ''create'' it if it doesn't exist, then you can ''add'' it to the work.
While the sections below detail each step required to create a category and assign it to a library work, the fastest workflow that we've found is like this:<blockquote>
# Import your library work,
# After cleaning it up and finishing it, add the categories, whether they already exist or not.
# Save your changes and scroll to the bottom of the page to see the categories.
# If any categories are red when you mouse over, click on their name.
# Doing so will open a tab and take you straight to the editor to create the category. Switch to source editor.
# Create the category with the page empty. Simply save your edit and, when asked for confirmation, click yes.
# Repeat as necessary for all categories that don't exist yet.
# Refresh the page of the library work, and all category names should be blue.
</blockquote>


==== Naming your category ====
==== Naming your category ====
Before we create a category, note that it must be called "Library works by/about X". The reason for that is that if you add, say, [[:Category:People's Republic of China|Category:China]] to a library work, it will join actual wiki pages that are about China. These two shouldn't mix as the library is entirely different from our main articles.
Before we create a category, note that it must be called "'''Library works by/about X'''". The reason for that is that if you add, say, [[:Category:People's Republic of China|Category:China]] to a library work, it will join actual wiki pages that are about China. These two shouldn't mix as the library is entirely different from our main articles.


Also note the case. It's not Library '''W'''orks, it's Library '''w'''orks.
Also note the case. It's not Library '''w'''orks, not Library '''W'''orks.


Some examples include:
Some examples include:
Line 72: Line 151:
* Library works about economics
* Library works about economics


Examples are endless, but they need to make sense. "Library works about history" for example is very large, and might not make the most sense. Remember though that categorizing a book does not instantly put it in the library page, we still need to add the topic and card template. So feel free to categorize as many works as you can!
Examples are endless, but they need to make sense. "Library works about history" for example is very large, and might not make the most sense -- but this is something we'll refine with time, as the need to create more specific categories grows. Remember though that categorizing a book does not instantly put it in the library page, we still need to add the topic and card template. So feel free to categorize as many works as you can!


==== Creating a category ====
==== Creating a category ====
It's good practice to create a category before you start using it. To create a category, simply do it like you would a new page: search for Category:Library works by X, and if it doesn't exist, click on the red link to create it. This is in the main user guide if you need more help with this.
To create a category, simply do it like you would a new page: search for Category:Library works by X, and if it doesn't exist, click on the red link to create it. This is in the main user guide if you need more help with this.


'''Make sure to look at the search results to see if your category already exists but you just mistyped it!!''' (remember ProleWiki is case-sensitive).
'''Make sure to look at the search results to see if your category already exists but you just mistyped it!!''' (remember ProleWiki is case-sensitive).
Line 81: Line 160:
Create your category using the source editor and just click "save changes". You will get a warning that the page is empty, but this is normal. We don't fill these pages ourselves, they are automatically populated. See for example [[:Category:Library works by Deng Xiaoping]].
Create your category using the source editor and just click "save changes". You will get a warning that the page is empty, but this is normal. We don't fill these pages ourselves, they are automatically populated. See for example [[:Category:Library works by Deng Xiaoping]].


We ''could'' add our own content, which would show at the top of the category page. This would allow us, for example, to organise some works in a given category. This is hypothetical, we haven't really done it yet.
We ''could'' add our own content, which would show at the top of the category page. This would allow us, for example, to organise some works in a given category. This is hypothetical though, we haven't really done it yet.


==== Adding a category to a work ====
==== Adding a category to a work ====

Latest revision as of 23:06, 26 September 2023

mockup of the new library

Welcome to this subpage for the new library.

We are completely redoing our library to make it more user-friendly and easier to browse.

Please read this page thoroughly to understand how to use and add works/topics to the new library.

How the new Library is organised

Topics

The new library works by topics. A topic can be an author, a place, a subject, or anything you want.

In the screenshot, we see for example "Marxist-Leninist authors". This is one topic which appears on the library page. It's simply created with a Heading (level 1 heading).

Cards (or full size cards)

Inside each topic, there are cards (Stalin, Lenin in the screenshot) that are about a category. These cards are added with the Template:Library card.

If you click on Stalin, for example, you will be taken to the page Category:Library works by Joseph Stalin. You can change the name of the card to be whatever you want, but we'll go over that in the next section.

A full-sized card like the one for Stalin links to a category page, it cannot link to anything else.

We generally want to use those cards for our biggest or "main" authors that are near the top of the page, so it's unlikely you'll actually have to use the full-size cards.

Mini cards

We also added "mini cards" because some thought the cards themselves took too much space. They are made with the Template:Library card mini.

These cards are similar to the full-format cards but take more parameters because they can link to anything. See next chapter below to learn how to use the card.

Overall organisation

This gives the new library a scalable format: we can have topics about anything we want, with the same work appearing in different categories. We could even have reading lists made by our editors, for example.

Note that in this new view (but much like the old library), any work that exists in the Library: namespace but isn't in a card category will essentially be invisible. It's good practice then to categorize all our works, especially as you import them to the library.

How to add something to the library

You need to work on the library with the source editor, as the visual editor will mess it up.

Adding a topic

Full-size cards

To add a topic, you simply need to add a heading (level of your choice) on the page. Then, you should add <div class="library-container"></div> right under it. It will look like this:

== Marxist-Leninist authors ==
<div class="library-container">
/* Card templates go here */
</div> 

This div is not optional! Without it, the library will not render properly. You also need to close the div tag with </div> as it's HTML code.

If this is complicated for you, you can simply copy another section of the library in the source editor and paste it to the topic you want to create.

Mini cards

To add a mini card section to the library, it's the same code but with <div class="library-container-mini"> instead. (just add the -mini to the div class).

You still have to close the div, and only mini cards should go in there.

Adding a card

Full-size card

Next, as you can see from the code above, you need to add the card template to your topic section.

This template is quite easy to use:

{{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}

You can simply copy this code and change the parameters as needed. These are:

  • image: upload a picture (or use one that's already uploaded) for the author. Use the filename with the extension and no spaces. Please make sure your picture is in color! (We use effects to make it b&w and bring color back when you hover over the card).
  • category: Library works by/about X. We'll go over how to create categories later.
  • name: name you want to appear on the card. Can be anything.
  • top and left: Optional fields. You can offset the picture vertically and horizontally (in pixels) so it's properly aligned in the card. I recommend using very small digits like 5 or 10.

And it will look like this:

There's no limits to the number of cards you can add under every topic, but it's good practice to linebreak after every card you add. This is how a topic looks like after it's filled out:

== Marxist-Leninist authors ==
 <div class="library-container">
 {{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}
 {{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}
 {{Library card|image=Iosif_Stalin.jpg|category=Library works by Joseph Stalin|name=Stalin|top=0|left=-25}}
 </div>

Mini card

You use the mini card template like this:

{{Library card mini|name=Rosa Luxemburg|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}

Which will look like this:

Rosa Luxemburg
Library works by Rosa Luxemburg

There are more parameters (image, text, etc) in this template than on the full-size card. Here they are explained:

Parameter Documentation
image The image you want to use for this card. Upload it, then copy the entire filename over (with the extension)
link The link you want the image to redirect to. Should be the same link as in the text, and you should also use the brackets [[ for it to work.
name The name for the Table of Content entry, so that the mini card is searchable on the TOC.
text Finally, the text you want to appear next to the card (above is Library works by Rosa Luxemburg). You have around 12-14 words available (3 lines) which should be more than enough; if you type in too many words, the card will look wrong, giving you a signal to reduce the word count.

To add a link to a category, wrap it in [[ ]] as normal on the source editor, but don't forget to add a colon (:) before Category -- see the code above.

Adding mini-cards on the library page will look just like this:

 <div class="library-container-mini">
 {{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=[[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}
 {{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}
 {{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}
 {{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}
 <{{Library card mini|image=Rosa_Luxemburg_colorised.jpeg|text=Library works by [[:Category:Library works by Rosa Luxemburg|Rosa Luxemburg]]|link=[[:Category:Library works by Rosa Luxemburg]]}}
 </div>
 

Adding categories to works

Finally, we need to add categories to works. Categories are a namespace; refer to the user guide if you need help on that.

While the sections below detail each step required to create a category and assign it to a library work, the fastest workflow that we've found is like this:

  1. Import your library work,
  2. After cleaning it up and finishing it, add the categories, whether they already exist or not.
  3. Save your changes and scroll to the bottom of the page to see the categories.
  4. If any categories are red when you mouse over, click on their name.
  5. Doing so will open a tab and take you straight to the editor to create the category. Switch to source editor.
  6. Create the category with the page empty. Simply save your edit and, when asked for confirmation, click yes.
  7. Repeat as necessary for all categories that don't exist yet.
  8. Refresh the page of the library work, and all category names should be blue.

Naming your category

Before we create a category, note that it must be called "Library works by/about X". The reason for that is that if you add, say, Category:China to a library work, it will join actual wiki pages that are about China. These two shouldn't mix as the library is entirely different from our main articles.

Also note the case. It's not Library works, not Library Works.

Some examples include:

  • Library works by Michael Parenti
  • Library works by Joseph Stalin
  • Library works about China
  • Library works about feudalism
  • Library works about economics

Examples are endless, but they need to make sense. "Library works about history" for example is very large, and might not make the most sense -- but this is something we'll refine with time, as the need to create more specific categories grows. Remember though that categorizing a book does not instantly put it in the library page, we still need to add the topic and card template. So feel free to categorize as many works as you can!

Creating a category

To create a category, simply do it like you would a new page: search for Category:Library works by X, and if it doesn't exist, click on the red link to create it. This is in the main user guide if you need more help with this.

Make sure to look at the search results to see if your category already exists but you just mistyped it!! (remember ProleWiki is case-sensitive).

Create your category using the source editor and just click "save changes". You will get a warning that the page is empty, but this is normal. We don't fill these pages ourselves, they are automatically populated. See for example Category:Library works by Deng Xiaoping.

We could add our own content, which would show at the top of the category page. This would allow us, for example, to organise some works in a given category. This is hypothetical though, we haven't really done it yet.

Adding a category to a work

To add/apply a category to a work, we also show how to do that in the main user guide.

You can find all our Library works here: Special:AllPages. In the "namespace" dropdown menu, select Library and click Go.