User:Novem Linguae/Scripts/SpeciesHelper

SpeciesHelper
DescriptionFor species articles, tries to add the correct short description, speciesbox, category, taxonbar, and stub template.
Author(s)Novem Linguae
UpdatedOctober 5, 2023
    (6 months ago)
SourceUser:Novem Linguae/Scripts/SpeciesHelper.js

For species articles, try to add the correct short description, speciesbox, category, taxonbar, and stub template.

Designed for edit

  • Species articles only
  • Not for higher taxa (genus, family, etc.)
  • Not for viruses

How to use edit

  • This script adds a "Run SpeciesHelper" link to the left menu. Click that. It will then take you to a diff screen where you can double check everything.
  • You can also run it using the hotkey combination Alt+A. Then use Alt+Shift+S to save the edit.

Features edit

  • Stub - If the article is 150 words or less of readable prose, will grab the entire taxonomy of the species, then work from the bottom up of that taxonomy until it finds the most specific stub possible. Will skip stubbing in draftspace.
  • Taxonomy category - Will grab the entire taxonomy of the species, then work from the bottom up of that taxonomy until it finds the most specific taxonomy category possible. If it finds a genus category, it will also add the species as a disambiguator, e.g. [[Category:Homo|sapien]]. In draftspace, will add the category with a colon, e.g. [[:Category:Homo|sapien]]
  • Taxonbar - If a Wikidata ID exists, will add a taxonbar with the correct Wikidata ID.
  • Improve categories - If there is 1 category or less, will add the maintenance tag {{Improve categories}}. Since the ideal set of categories for a species article is usually 3 categories: 1 taxonomy category, 1 flora/fauna of country category, and 1 described in X year category.
  • Speciesbox - If no taxobox or speciesbox of any kind is present, will add a {{Speciesbox}}
  • Template:Taxonomy - If Template:Taxonomy does not exist for that genus, will alert the user so they can create it.
  • Italic title - Removes unnecessary {{Italic title}} templates.
  • Taxobox - If there is a {{Taxobox}} or {{Automatic taxobox}}, will convert it to {{Speciesbox}}
  • Short descriptions - If no short description is present, and the phrase "is a species of" is present in the article, will capture what is after that phrase and add it as a short description, e.g. X is a species of pufferfish in the genus Y will generate {{Short description|Species of pufferfish}}.
  • Cleanup - Will clean up some common issues. Will convert <references /> to {{Reflist}}, heading level 1's to heading level 2's, will remove excessive newlines, will remove empty {{DEFAULTSORT}}s, and some other small adjustments.

Issues edit

This script shows a diff of suggested changes for the user to evaluate before saving. Please check this diff carefully. The script is not perfect.

  • Detailed list of known issues.
  • If a category or stub uses a non-latin name instead of a latin name, this can confuse the script. There is a dictionary of non-latin name = latin name equivalents that help improve its accuracy, but it is not 100% comprehensive.
  • If there is a category at the species level, such as Category:Chimpanzees, doesn't currently handle these, resulting in over-categorization.

Planned future features edit

  • Wikidata - When an exact latin species name match is found in Wikidata, automatically link the two articles.
  • Category:Described in year - Analyze the wikitext for "described in 2015" or similar, and add the appropriate category.

Converting taxoboxes to speciesboxes edit

  • This is one of the things that SpeciesHelper does automatically.
  • Seems like the current consensus is that it's desirable to convert taxobox to speciesbox in all articles, except for certain gastropods.[1] As such, I have programmed SpeciesHelper to skip conversion for gastropod articles.

Missing Template:Taxonomy edit

 
Wikipedia user script SpeciesHelper Template:Taxonomy alert

This script depends on some hidden templates that are sub-pages of Template:Taxonomy. Sometimes the script will alert you that Template:Taxonomy/abc is missing and needs to be created.

These templates can be complicated to create, so one way to handle this is to skip these articles.

If you want to take a stab at creating Template:Taxonomy/abc yourself in newer articles, here are some tips.

  • Assume that you want to add a speciesbox to the article "Homo sapien", but SpeciesHelper alerts you that Template:Taxonomy/Homo is missing.
  • Navigate to Template:Taxonomy/Homo and create the article. Make sure to capitalize Homo.
  • Find where it says Thanks for creating this page. Code should already be in the box below. If not, click here to reset. Click on "click here to reset", which will pre-fill the page with the correct template.
  • Fill in |rank= with the correct rank, in latin. Will be "genus" for the first one, then something else if you need to create higher ranked templates above that. List of latin ranks. Use Latin, not English. For example, use tribus, not tribe.
  • Fill in |parent= with the parent taxon. Use a source such as http://www.indexfungorum.org/ for fungi or https://marinespecies.org/ for marine animals to view the species' entire taxonomic tree. You can use this to determine the parent.
  • Fill in |refs= with the website you obtained the information from. Using {{Cite web}} is recommended so that you can indicate the |access-date=. Some specialized citation templates exist, such as {{Cite WoRMS}} and {{inaturalist taxon}}
  • Click save. If a big list of taxa appears as a table on the right side of the page, you're done. If you get a bunch of errors, then you need to add the parent taxon using the same process, until you link your subtree to an existing taxonomy template.

My other user script, TemplateTaxonomyAddCite, assists with searching databases and adding citation templates.

See also edit

Notes edit


Novem Linguae's user scripts (VE)
# of users Name Description S++ US/L
350 CiteHighlighter Highlights 1,800 sources green, yellow, or red depending on reliability. Mainly pulls its data from WP:RSP, WP:NPPSG and WikiProject reliable sources lists. x x
260 GANReviewTool Quickly and easily close good article nominations. Takes care of {{atop}}ing the discussion and changing the talk page templates. x x
62 DraftCleaner.js Fix formatting of new articles. x x
54 UserHighlighterSimple Highlights usernames based on permissions and edit count. User data updated daily by NovemBot. Highlights former admins. x x
54 VisualEditorEverywhere Displays the Visual Editor "Edit" tab and "Edit" section link on pages that don't normally have them: templates, talk pages, Wikipedia namespace. x x
52 NPPLinks Adds WP:BEFORE, copyvio check, duplicate article check, and other useful New Page Patrol links to the left menu. I like to mouse wheel click these links, which opens them in new tabs without losing focus on the current tab. Includes a professor h-index search. x x
42 VoteCounter.js Display keep and delete counts in XFD discussions. Also display counts in talk page discussions. x
37 DetectSNG Scans a list of 1,600 SNG keywords such as "National Football League" and, if found, displays them at the top of the article page, to help with determining SNG eligibility. x
30 UserRightsDiff.js When viewing Special:UserRights, easily see what perm was added or removed. x
27 ReviewStatus Displays whether or not a mainspace page is marked as reviewed x x
25 WatchlistAFD.js Automatically watchlist the AFD pages of your AFC accepts and NPP curations for 6 months, so you can see when stuff is AFD'd and you can calibrate your reviewing. By default, the patroller is not notified of AFD nominations, so this helps fix that. For user profiles, can also "Watchlist SPI" and "Watchlist RFA". x
21 SpeciesHelper For species articles, tries to add the correct speciesbox, category, taxonbar, and stub template. x x
20 DetectPromo.js If promotional words are detected, displays them in orange at the top of the article.
20 DetectG4G5.js If an unreviewed article was created by a blocked user, or has had an AFD, displays a warning, so you can investigate if it needs CSD G4 or G5.
12 Links.js Adds links to the left menu, including a user's common.js/global.js/vector.js, central auth, subpages, rename log, global lock log. Also adds pending changes.
12 anrfc-lister.js Effortlessly submit RFCs to the RFC closing noticeboard, WP:ANRFC. x
11 DontForgetG12.js Puts a big orange "Copyvio check" button at the top of unreviewed drafts and articles
6 TemplateTaxonomyAddCite Create subpages of Template:Taxonomy more easily by clicking a button to add citation wikicode.
6 ShowAdminMessages.js Reveal and highlight hidden messages for admins and other user groups.
6 UserTalkErasedSectionsDetector.js Detect if a user is whitewashing their User Talk by deleting warnings
5 CWWEditSummary.js When copying within Wikipedia, makes it easier to leave an edit summary mentioning attribution

Less popular: CopyTitle.js, EditRequestReadFAQ.js, RequestedArticleSifter.js, SpecialNewPagesFeedBetaTestLink.js, User:Novem Linguae/Scripts/TopicSubscriptionsTab.js, User:Novem Linguae/Scripts/Vector2022NoWhitespace.js, User:Novem Linguae/Scripts/Vector2022NoFloatingTopBar.js

Deprecated (built into MediaWiki now): NotSoFast

Comfortable with GitHub? Submit bug reports and feature requests here