dokuwiki 1.2 → 1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/dokuwiki.rb +10 -5
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ae1657c508dd975aaf7a92b0cc0e599f4768593369a7dc3f1604ca08a862088
4
- data.tar.gz: b66cb5e15d54b44c7edb1da76eb6c8ff0b4c24f45e4674eceedfd9cb4aad5d0a
3
+ metadata.gz: fbbc62f3ad854a8ce431488a5d2a41c9693c7fa1d072e4413e4be4d79596b45f
4
+ data.tar.gz: 2e18e0bbbb54312f2c3c0d19ccce3426199994f7395dcbc486d96dbe1670ac0d
5
5
  SHA512:
6
- metadata.gz: 95e388de7808ee29c085303f700888c2e040b93eb46b6a74b11be36f55ad700af197f9ec2c02459c92e9ddbf9293d0364e924c6b380a712c2dce6a9a1f5f3dd6
7
- data.tar.gz: 7c947cc49174c853201e3534036a59e5afe2cc5c8e0e31241c44f43cc82bbaa14aaba90d237b8e74bf92af6772d60ac9d9ab9622e6d73a3579c8c27a57c1c7f4
6
+ metadata.gz: 319c5f9d2526537add900357a46a3257a75c2d70065caf050569c9d29b04ecef8d87bf10d06524b1f1dc61d4a704cb1a6bd1846a6b5e8531810e0d216845287e
7
+ data.tar.gz: 8c7f5f37defffe8931d79b66c7e40a046060193c1668271124e175b5775bf849b1477a93655677057c27866eee684781669af34c26bb1918ea577a06f1a0f984
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.3 (2024-03-11)
2
+
3
+ - downloads pages via raw instead of edit
4
+
1
5
  ## 1.2 (2022-04-13)
2
6
 
3
7
  - add support for csv, svg and txt media files
data/lib/dokuwiki.rb CHANGED
@@ -26,6 +26,7 @@ module DokuWiki
26
26
  # DokuWiki.upload_dir
27
27
  # DokuWiki.wait_second
28
28
  # DokuWiki.namespace( wikipath )
29
+ # DokuWiki.export_url( wikipath )
29
30
  # DokuWiki.edit_url( wikipath )
30
31
  # DokuWiki.get( url )
31
32
  # DokuWiki.login( wikipath, user, pass )
@@ -88,6 +89,11 @@ module DokuWiki
88
89
  wikipath.gsub( ':', '%3A' ).freeze
89
90
  end
90
91
 
92
+ # make export url
93
+ def export_url( wikipath )
94
+ "#{@dokuwiki_page_url}#{wikipath}&do=export_raw"
95
+ end
96
+
91
97
  # make edit url
92
98
  def edit_url( wikipath )
93
99
  "#{@dokuwiki_page_url}#{wikipath}&do=edit"
@@ -157,11 +163,10 @@ module DokuWiki
157
163
 
158
164
  # save wiki source to file
159
165
  def save_wiki_source( page, filename )
160
- f = page.form_with( id: 'dw__editform' )
161
- wikitext = f.field_with( name: 'wikitext' ).value.delete( "\r" )
166
+ wikitext = ''
167
+ wikitext = page.body \
168
+ if page.header[ 'content-type' ].include?( 'text/plain' )
162
169
  file_put_contents( filename, wikitext )
163
- button = f.button_with( name: 'do[draftdel]' )
164
- @agent.submit( f, button )
165
170
  end
166
171
 
167
172
  # save wiki body to file
@@ -196,7 +201,7 @@ module DokuWiki
196
201
  url = @dokuwiki_page_url + wikipath.sub( /[.]html$/, '' )
197
202
  save_wiki_body( filename, url )
198
203
  else
199
- url = edit_url( wikipath )
204
+ url = export_url( wikipath )
200
205
  filename << ".#{EXTENSION}"
201
206
  page = get( url )
202
207
  save_wiki_source( page, filename )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dokuwiki
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: '1.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dirk Meyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-13 00:00:00.000000000 Z
11
+ date: 2024-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-cookie
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  requirements: []
85
- rubygems_version: 3.3.26
85
+ rubygems_version: 3.4.19
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: access DokuWiki server