User:DaxServer/BooksToSfn
Description | Converts a {{cite book}} to use {{Sfn}} |
---|---|
Author(s) | DaxServer |
Status | Release candidate |
First released | October 25, 2021 |
Updated | October 28, 2021 |
Browsers | Brave, Google Chrome, Firefox |
Skins | Vector |
Source | User:DaxServer/BooksToSfn.js |
The script will add a "Books to Sfn" portlet link in Visual Editor's source mode editing, in main namespace articles or in the user's Sandbox. When clicked, it converts one {{cite book}}
inside a <ref>...</ref>
tag block into an {{Sfn}}
.
The script looks for a level-2/3 "Bibliography" section with a {{Refbegin}}
–{{Refend}}
block and appends the {{cite book}}
inside the block. If not, it will look for a level-2 "References" section and create a level-3 "Bibliography" section. After the conversion, a success message or a failure message (with more details in the browser console) would be displayed. Verify the conversion and make any changes necessary. It's recommended to save one change at a time so as to have a good page history.
Capabilities
[edit]The script is capable of identifying the last names required by {{Sfn}}
in this order:
last
last1
...lastn
author
author1
...authorn
editor
editor1
...editorn
The script is capable of identifying year from the parameters year
or date
. It is capable of identifying page numbers from the parameters page
or pages
.
Installation instructions
[edit]Hint: It's much easier if you get ScriptInstaller, then navigate to User:DaxServer/BooksToSfn.js and click "Install" at the top.
However, here's the manual method:
- Place
{{subst:iusc|User:DaxServer/BooksToSfn.js}}
on Special:MyPage/common.js or a skin-specific page, like Special:MyPage/vector.js. - Clear your cache and enjoy!